You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 28, 2019. It is now read-only.
My plunker at http://plnkr.co/edit/OM1O89Aw0wi1wDgn9ul5?p=preview demonstrates the issue. Try selecting a date NOT in the current year (i.e. if you're seeing this in 2013, try selecting a date in 2014). You'll notice that the date object in the scope -- $scope.myDate -- still has 2013 as the year.
This actually happens because of how jquery-ui responds to the dateFormat setting. However, when you're in the angular world, you'd expect the following behaviour:
The underlying date object should always be correct and neither dateFormat, altFormat, nor ui-date-format should affect what gets stored in it
The above mentioned settings should affect ONLY what is displayed to the user.
Please note, using ui-date-format does NOT solve this issue. Because that causes the ui-date to accept and emit strings into the ngModel. How does one continue to have a Date object in the ngModel while changing what is displayed to the user.
My plunker at http://plnkr.co/edit/OM1O89Aw0wi1wDgn9ul5?p=preview demonstrates the issue. Try selecting a date NOT in the current year (i.e. if you're seeing this in 2013, try selecting a date in 2014). You'll notice that the date object in the scope --
$scope.myDate-- still has 2013 as the year.This actually happens because of how jquery-ui responds to the
dateFormatsetting. However, when you're in the angular world, you'd expect the following behaviour:dateFormat,altFormat, norui-date-formatshould affect what gets stored in itPlease note, using
ui-date-formatdoes NOT solve this issue. Because that causes the ui-date to accept and emit strings into the ngModel. How does one continue to have a Date object in the ngModel while changing what is displayed to the user.