mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-18 13:12:16 +01:00
fix time picker messing up the date when number exceeds 24 hours
This commit is contained in:
@@ -29,7 +29,7 @@ function updateMinutes(event: Event) {
|
|||||||
const newValue = target.value;
|
const newValue = target.value;
|
||||||
if (!isNaN(parseInt(newValue))) {
|
if (!isNaN(parseInt(newValue))) {
|
||||||
model.value = getLocalizedDayJs(model.value)
|
model.value = getLocalizedDayJs(model.value)
|
||||||
.set('minutes', parseInt(newValue))
|
.set('minutes', Math.min(parseInt(newValue), 59))
|
||||||
.utc()
|
.utc()
|
||||||
.format();
|
.format();
|
||||||
}
|
}
|
||||||
@@ -40,7 +40,7 @@ function updateHours(event: Event) {
|
|||||||
const newValue = target.value;
|
const newValue = target.value;
|
||||||
if (!isNaN(parseInt(newValue))) {
|
if (!isNaN(parseInt(newValue))) {
|
||||||
model.value = getLocalizedDayJs(model.value)
|
model.value = getLocalizedDayJs(model.value)
|
||||||
.set('hours', parseInt(newValue))
|
.set('hours', Math.min(parseInt(newValue), 23))
|
||||||
.utc()
|
.utc()
|
||||||
.format();
|
.format();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user