mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-17 12:42:15 +01:00
make sure that timepicker and calendar set seconds to 0 on update, fixes #968
This commit is contained in:
@@ -196,11 +196,13 @@ async function handleEventDrop(arg: EventDropArg) {
|
|||||||
start: getDayJsInstance()(arg.event.start.toISOString())
|
start: getDayJsInstance()(arg.event.start.toISOString())
|
||||||
.utc()
|
.utc()
|
||||||
.tz(getUserTimezone(), true)
|
.tz(getUserTimezone(), true)
|
||||||
|
.second(0)
|
||||||
.utc()
|
.utc()
|
||||||
.format(),
|
.format(),
|
||||||
end: getDayJsInstance()(arg.event.end.toISOString())
|
end: getDayJsInstance()(arg.event.end.toISOString())
|
||||||
.utc()
|
.utc()
|
||||||
.tz(getUserTimezone(), true)
|
.tz(getUserTimezone(), true)
|
||||||
|
.second(0)
|
||||||
.utc()
|
.utc()
|
||||||
.format(),
|
.format(),
|
||||||
} as TimeEntry;
|
} as TimeEntry;
|
||||||
@@ -217,11 +219,13 @@ async function handleEventResize(arg: EventChangeArg) {
|
|||||||
start: getDayJsInstance()(arg.event.start.toISOString())
|
start: getDayJsInstance()(arg.event.start.toISOString())
|
||||||
.utc()
|
.utc()
|
||||||
.tz(getUserTimezone(), true)
|
.tz(getUserTimezone(), true)
|
||||||
|
.second(0)
|
||||||
.utc()
|
.utc()
|
||||||
.format(),
|
.format(),
|
||||||
end: getDayJsInstance()(arg.event.end.toISOString())
|
end: getDayJsInstance()(arg.event.end.toISOString())
|
||||||
.utc()
|
.utc()
|
||||||
.tz(getUserTimezone(), true)
|
.tz(getUserTimezone(), true)
|
||||||
|
.second(0)
|
||||||
.utc()
|
.utc()
|
||||||
.format(),
|
.format(),
|
||||||
} as TimeEntry;
|
} as TimeEntry;
|
||||||
@@ -243,7 +247,7 @@ const calendarOptions = computed(() => ({
|
|||||||
slotDuration: '00:15:00',
|
slotDuration: '00:15:00',
|
||||||
slotLabelInterval: '01:00:00',
|
slotLabelInterval: '01:00:00',
|
||||||
slotLabelFormat: getSlotLabelFormat(),
|
slotLabelFormat: getSlotLabelFormat(),
|
||||||
snapDuration: '00:15:00',
|
snapDuration: '00:01:00',
|
||||||
firstDay: getFirstDay(),
|
firstDay: getFirstDay(),
|
||||||
allDaySlot: false,
|
allDaySlot: false,
|
||||||
nowIndicator: true,
|
nowIndicator: true,
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ function updateTime(event: Event) {
|
|||||||
model.value = getLocalizedDayJs(model.value)
|
model.value = getLocalizedDayJs(model.value)
|
||||||
.set('hours', Math.min(parseInt(hours), 23))
|
.set('hours', Math.min(parseInt(hours), 23))
|
||||||
.set('minutes', Math.min(parseInt(minutes), 59))
|
.set('minutes', Math.min(parseInt(minutes), 59))
|
||||||
|
.set('seconds', 0)
|
||||||
.format();
|
.format();
|
||||||
emit('changed', model.value);
|
emit('changed', model.value);
|
||||||
}
|
}
|
||||||
@@ -42,6 +43,7 @@ function updateTime(event: Event) {
|
|||||||
model.value = getLocalizedDayJs(model.value)
|
model.value = getLocalizedDayJs(model.value)
|
||||||
.set('hours', Math.min(parseInt(hours), 23))
|
.set('hours', Math.min(parseInt(hours), 23))
|
||||||
.set('minutes', Math.min(parseInt(minutes), 59))
|
.set('minutes', Math.min(parseInt(minutes), 59))
|
||||||
|
.set('seconds', 0)
|
||||||
.format();
|
.format();
|
||||||
emit('changed', model.value);
|
emit('changed', model.value);
|
||||||
} else if (newValue.length === 3) {
|
} else if (newValue.length === 3) {
|
||||||
@@ -50,6 +52,7 @@ function updateTime(event: Event) {
|
|||||||
model.value = getLocalizedDayJs(model.value)
|
model.value = getLocalizedDayJs(model.value)
|
||||||
.set('hours', Math.min(parseInt(hours), 23))
|
.set('hours', Math.min(parseInt(hours), 23))
|
||||||
.set('minutes', Math.min(parseInt(minutes), 59))
|
.set('minutes', Math.min(parseInt(minutes), 59))
|
||||||
|
.set('seconds', 0)
|
||||||
.format();
|
.format();
|
||||||
emit('changed', model.value);
|
emit('changed', model.value);
|
||||||
} else if (newValue.length === 2) {
|
} else if (newValue.length === 2) {
|
||||||
@@ -57,6 +60,7 @@ function updateTime(event: Event) {
|
|||||||
model.value = getLocalizedDayJs(model.value)
|
model.value = getLocalizedDayJs(model.value)
|
||||||
.set('hours', Math.min(parseInt(newValue), 23))
|
.set('hours', Math.min(parseInt(newValue), 23))
|
||||||
.set('minutes', 0)
|
.set('minutes', 0)
|
||||||
|
.set('seconds', 0)
|
||||||
.format();
|
.format();
|
||||||
emit('changed', model.value);
|
emit('changed', model.value);
|
||||||
} else if (newValue.length === 1) {
|
} else if (newValue.length === 1) {
|
||||||
@@ -64,6 +68,7 @@ function updateTime(event: Event) {
|
|||||||
model.value = getLocalizedDayJs(model.value)
|
model.value = getLocalizedDayJs(model.value)
|
||||||
.set('hours', Math.min(parseInt(newValue), 23))
|
.set('hours', Math.min(parseInt(newValue), 23))
|
||||||
.set('minutes', 0)
|
.set('minutes', 0)
|
||||||
|
.set('seconds', 0)
|
||||||
.format();
|
.format();
|
||||||
emit('changed', model.value);
|
emit('changed', model.value);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user