-
Notifications
You must be signed in to change notification settings - Fork 6.7k
Timepicker - leading zeros should not be deleted in the minutes field #1598
Comments
Notes for myself: As long as the input field is focused, the leading zero in the minute field is 'deleted'. On blur, minutes are correctly displayed with a leading zero. Easily reproduced from the demo page. |
This is getting set in the getMinutesFromTemplate function where the $scope.munites is checked for being between 0 and 60 by calling parseInt. The updateMinutes function uses this result to set the field validation. The updateTemplate function is responsible for setting the leading zeros where there is specific logic to skip zero padding when called from a keyboardChange. Changing:
To:
Fixes this issue for both the hours and minutes. |
I think the padded version should be on the minutes version by default, but not necessarily the hours - the hours should be opt-in. |
Out of curiosity.. what was the reason for only padding minutes and not hours.. and is there plans to add the opt-in for the hours. My end users would like the hours to work the same way as minutes. |
Always padding minutes makes sense because if say the default time is 10:00, then typing 5 in the minutes column would end up 10:5, which is an incorrect time. However, if someone typed 1 in the hours column, most people expect 1:00, not 01:00. |
But after you navigate away it does convert it to 01:00..so if the user ever typed in 01 why would both dropping the zero only to have it appear again after they navigate away.. |
Hi i think i have the same problem ... When i wrote in the input "01" in the hours column , only "1" appears and when i leave the input the "0" appear. But i want keep the "0" in all case in the hours column . How can i do that ? Thank you :) |
This is bad for user experience - If I type 10:05, I look up and only see 10:5, and think i missed the 0, go back, try to add it, nothing happens.
Same thing when typing 10:00 - it should display that way in the field when I type.
The text was updated successfully, but these errors were encountered: