Skip to content

Commit

Permalink
fix time picker messing up the date when number exceeds 24 hours
Browse files Browse the repository at this point in the history
  • Loading branch information
Onatcer committed Jun 6, 2024
1 parent 1fdbfe7 commit ffea3c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions resources/js/Components/Common/TimePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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();
}
Expand Down

0 comments on commit ffea3c6

Please sign in to comment.