eight04 / angular-datetime

A directive to add the behavior of datetime input on unsupported browsers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Entering days with leading "0" causes wrong date

troxler opened this issue · comments

The behaviour when entering day of month with a leading zero is wrong. I have an input with datetime="longDate. Assume the input value is "January 1, 2016". When setting the focus to the day of month and press the 0 key, the resulting value is "December 31, 2015".

A probably better behaviour would be to ignore the zero (depending on the format, of course) and after entering one of 1-9 to focus the next format group (in this case the year). So when pressing "02" on "January 1, 2016", the resulting value should be "January 2, 2016" with having the focus on the year.

Very cool extension btw!

commented

Sounds good. I guess some other formats (i.e. 'y', 'M', 'H', 'h', 'm', 's', 'w') should also work like this.

commented

Fixed in 2.2.0

Awesome! Thank you.