diff --git a/src/store/models.ts b/src/store/models.ts index ec45877..0b10f28 100644 --- a/src/store/models.ts +++ b/src/store/models.ts @@ -16,9 +16,6 @@ export type EditableJob = Omit, 'id'> & { export function emptyJob(startDate = new Date()): EditableJob { const start = date.adjustDate(startDate, { hours: new Date().getHours(), - minutes: 0, - seconds: 0, - milliseconds: 0, }); return { start: start, @@ -29,9 +26,9 @@ export function emptyJob(startDate = new Date()): EditableJob { }; } -export function emptyEvent(startDate?: Date): EditableEvent { +export function emptyEvent(startDate: Date = new Date()): EditableEvent { return { - start: startDate === undefined ? new Date() : new Date(startDate), + start: date.adjustDate(startDate, { hours: 0, minutes: 0, seconds: 0, milliseconds: 0 }), jobs: [emptyJob(startDate)], is_template: false, };