mgcrea / angular-strap

AngularJS 1.2+ native directives for Bootstrap 3.
mgcrea.github.io/angular-strap
MIT License
5.73k stars 1.38k forks source link

fix(datepicker): unable to select the same date as minDate and fixing syntax typo #2261

Closed prashanth2692 closed 7 years ago

prashanth2692 commented 7 years ago

Due to passing string with 'Z' into Date constructor the date value is being offset by browser's timezone which is causing the the datepicker to disable the day which is passed as minDate. Effectively not allowing to select the date which is set as minDate. This will be reproducible for user on East of UTC.

To fix the issue, checking for 'Z' in the date string and excluding it to get the Date object with the expected date.