-
Notifications
You must be signed in to change notification settings - Fork 6.7k
non-dates are being parsed as valid dates #3104
Comments
I have an addition to this... I'm using the following format 'dd-MM-yyyy'. This also happens in the demo when I set the format to dd.MM.yyyy and enter 1.12.2014 |
+1. I am having the same problem. Adding a $formatter to try to change it to the correct value does not help because the $modelValue and the $viewValue are the same so we can't determine the input the user entered. |
I think I understand your problem @bolemeus. I also find default behaviour of datepicker not only annoying but just incorrect. I'll prepare some code/example at the evening and let you know. |
Hi again. I just created a plunker with newest version of angularjs and ui-boostrap (0.12.0) - http://plnkr.co/edit/yNuSZPiQYFn0Zy2COPdA |
I was hoping it's fixed but I checked once again and unfortunately it's still broken. I have to admit it works fine under Firefox, but not udner Chrome (couldn't check it under IE). So I'll prepare some code and let you know anyway. |
@wesleycho - this could be moved to 0.13.x? |
Problem is in 2nd condition: new Date('1'); FF 37.02: Date {Invalid Date} I expect from user date in provided format. |
@bartoszbobin this behaviour was already described. Have a look at plunker (link provided in my previous post) |
I have a datepicker on my site, using the following format 'dd-MM-yyyy'.
Because it is possible to manually insert a date I want the datepicker to do some validation on it.
However, when I enter the first digit of the date, for example a 1, the datepicker already assumes it's a valid date. It parses it into the date 1 January 2001. The date picker also fills the model with this incorrect date.
Because I use that date in a function that is called with a ng-change function this causes unwanted behaviour.
Is there something I'm missing, or is this a bug?
PS: this bug also happens in the demo.
http://angular-ui.github.io/bootstrap/#/datepicker#datepicker
The text was updated successfully, but these errors were encountered: