angular-ui / bootstrap

PLEASE READ THE PROJECT STATUS BELOW. Native AngularJS (Angular) directives for Bootstrap. Smaller footprint (20kB gzipped), no 3rd party JS dependencies (jQuery, bootstrap JS) required. Please read the README.md file before submitting an issue!
http://angular-ui.github.io/bootstrap/
MIT License
14.29k stars 6.73k forks source link

Datepicker #3976

Closed johneakin closed 9 years ago

johneakin commented 9 years ago

Hi, If I manually (via the textbox) set the date back a year i.e. change 2015 to 2014 then the control shows as invalid (i.e. a red border)

Is there a fix for this?

wesleycho commented 9 years ago

Can you create a reproduction on Plunker - this is not enough to go by or be sure what is happening.

ChristophT commented 9 years ago

I came across the same problem today. Seems to me, that the baseDate used in dateparser.js, line 130, is supposed to be a date object. If you enter the date manually however it is a string, so the call

year: baseDate.getFullYear(),

fails.

ChristophT commented 9 years ago

Created a plunkr. The date is initially set as string. A manual edit in the input box triggers the error. If you select a date via the picker or initialize mydate with new Date() everything works fine.

RobJacobs commented 9 years ago

@ChristophT, @wesleycho The datepicker has these open PRs: #3759, #3691, #3682, #3344, #2513, #2369, #2142 that are related to how the date is parsed. I updated the plunk with the latest build from the master branch so we can test against that.

wesleycho commented 9 years ago

3759 fixes this.

johneakin commented 9 years ago

If you go down to the Datepicker here

https://angular-ui.github.io/bootstrap/

and change 2015 in the textbox to 2014 you'll see the red error border around the calendar. Are we saying this is now fixed?