File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed
resources/js/packages/ui/src/Input Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -27,12 +27,19 @@ function updateTime(event: Event) {
2727 if (newValue .split (' :' ).length === 2 ) {
2828 const [hours, minutes] = newValue .split (' :' );
2929 if (! isNaN (parseInt (hours )) && ! isNaN (parseInt (minutes ))) {
30- model .value = getLocalizedDayJs (model .value )
31- .set (' hours' , Math .min (parseInt (hours ), 23 ))
32- .set (' minutes' , Math .min (parseInt (minutes ), 59 ))
33- .set (' seconds' , 0 )
34- .format ();
35- emit (' changed' , model .value );
30+ const currentTime = getLocalizedDayJs (model .value );
31+ const newHours = Math .min (parseInt (hours ), 23 );
32+ const newMinutes = Math .min (parseInt (minutes ), 59 );
33+
34+ // Only update if hours or minutes are different
35+ if (currentTime .hour () !== newHours || currentTime .minute () !== newMinutes ) {
36+ model .value = currentTime
37+ .set (' hours' , newHours )
38+ .set (' minutes' , newMinutes )
39+ .set (' seconds' , 0 )
40+ .format ();
41+ emit (' changed' , model .value );
42+ }
3643 }
3744 }
3845 // check if input is only numbers
You can’t perform that action at this time.
0 commit comments