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.3k stars 6.74k forks source link

altInputFormats for datepickerPopup is not being dynamically updates #6623

Open angelina999990 opened 6 years ago

angelina999990 commented 6 years ago

The issues forum is NOT for support requests. It is for bugs and feature requests only. Please read https://github.com/angular-ui/bootstrap/blob/master/CONTRIBUTING.md and search existing issues (both open and closed) prior to opening any new issue and ensure you follow the instructions therein.

Bug description:

For datepickerPopup, it only sets the alternate format when directive initial. if the alt-input-formats value changed, it won't update util reloading directive.

Link to minimally-working plunker that reproduces the issue:

https://plnkr.co/edit/uXyBumtqd92m4Q3GvK2r?p=preview

Steps to reproduce the issue:

open the link above:

  1. enter a date string (eg. 2017-1-30);
  2. click 'Change Input Formats' button;
  3. enter a new date string according to new alternate input format. (eg. 01/30/2017);

the selected date will not display any date because the date you just entered is not valid.

  1. try enter a date with format before clicking button (eg. 2017-7-30).

the alt-input-format value changed. but datepickerPopupDirective still use the very first one.

Version of Angular, UIBS, and Bootstrap

Angular: 1.5.7

UIBS: 2.5.0

Browser: Tested in Chrome