Move toId to shared/utils/functions.ts
This commit is contained in:
parent
02be8a37a5
commit
262a691ed6
4 changed files with 8 additions and 13 deletions
|
@ -90,15 +90,12 @@
|
|||
<script lang="ts" setup>
|
||||
import type { ChangeRecord, ScheduleLocation } from '~/shared/types/schedule';
|
||||
import { applyChangeArray } from '~/shared/utils/changes';
|
||||
import { toId } from '~/shared/utils/functions';
|
||||
|
||||
defineProps<{
|
||||
edit?: boolean
|
||||
}>();
|
||||
|
||||
function toId(name: string) {
|
||||
return name.toLowerCase().replace(/ /g, "-");
|
||||
}
|
||||
|
||||
const schedule = await useSchedule();
|
||||
|
||||
const changes = ref<ChangeRecord<ScheduleLocation>[]>([]);
|
||||
|
|
|
@ -210,7 +210,7 @@
|
|||
import { DateTime, Duration } from 'luxon';
|
||||
import type { ChangeRecord, Schedule, ScheduleEvent, ScheduleLocation, TimeSlot } from '~/shared/types/schedule';
|
||||
import { applyChangeArray } from '~/shared/utils/changes';
|
||||
import { enumerate, pairs } from '~/shared/utils/functions';
|
||||
import { enumerate, pairs, toId } from '~/shared/utils/functions';
|
||||
|
||||
const props = defineProps<{
|
||||
edit?: boolean,
|
||||
|
@ -240,10 +240,6 @@ interface Gap {
|
|||
end: DateTime,
|
||||
}
|
||||
|
||||
function toId(name: string) {
|
||||
return name.toLowerCase().replace(/[^a-z0-9]+/g, "-");
|
||||
}
|
||||
|
||||
function status(eventSlot: EventSlot) {
|
||||
if (
|
||||
!eventSlot.event
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue