diff --git a/ui/src/components/TimekeepingDate.svelte b/ui/src/components/TimekeepingDate.svelte new file mode 100644 index 0000000..3d23739 --- /dev/null +++ b/ui/src/components/TimekeepingDate.svelte @@ -0,0 +1,15 @@ + \ No newline at end of file diff --git a/ui/src/routes/WorkingHours/Formular.svelte b/ui/src/routes/WorkingHours/Formular.svelte index 370bf0a..0772955 100644 --- a/ui/src/routes/WorkingHours/Formular.svelte +++ b/ui/src/routes/WorkingHours/Formular.svelte @@ -3,6 +3,7 @@ import IconifyIcon from '@iconify/svelte' import checkIcon from '@iconify-icons/oi/check' import xIcon from '@iconify-icons/oi/x' + import {TimekeepingDate} from "../../components/TimekeepingDate.svelte" export let activeRecord = null export let newRecord = false @@ -10,14 +11,19 @@ 'saveRecord': () => { if (newRecord === true) { WorkingHoursRepository.add(activeRecord).then(() => { - Controller.cancelActiveRecord() + Controller.nextDay() }); } else { WorkingHoursRepository.update(activeRecord.workingDay, activeRecord).then(() => { - Controller.cancelActiveRecord() + Controller.nextDay() }); } }, + 'nextDay': () => { + let actDate = new TimekeepingDate(activeRecord.workingDay) + let nextDay = actDate.getNextDay() + activeRecord = {workingTime: '00:00:00', workingDay: nextDay.getDateString()} + }, 'cancelActiveRecord': () => { activeRecord = null; newRecord = false; @@ -39,7 +45,7 @@