mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-14 19:22:14 +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;
|
||||
if (!isNaN(parseInt(newValue))) {
|
||||
model.value = getLocalizedDayJs(model.value)
|
||||
.set('minutes', parseInt(newValue))
|
||||
.set('minutes', Math.min(parseInt(newValue), 59))
|
||||
.utc()
|
||||
.format();
|
||||
}
|
||||
@@ -40,7 +40,7 @@ function updateHours(event: Event) {
|
||||
const newValue = target.value;
|
||||
if (!isNaN(parseInt(newValue))) {
|
||||
model.value = getLocalizedDayJs(model.value)
|
||||
.set('hours', parseInt(newValue))
|
||||
.set('hours', Math.min(parseInt(newValue), 23))
|
||||
.utc()
|
||||
.format();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user