ngOfficeUIFabric / ng-officeuifabric

Office UI Fabric (https://github.com/OfficeDev/office-ui-fabric) implementation for Angular
http://ngOfficeUiFabric.com
MIT License
320 stars 67 forks source link

DatePicker bugfix for issue #485 #507

Closed nightullr closed 7 years ago

nightullr commented 7 years ago

I noticed issue 485 (using the month picker to change months multiple times will eventually cause the year to unexpectedly decrease) a while ago and finally got a chance to dig to figure out what was at fault. In both the click events for the month picker and the year picker, the DatePicker component is using the .day (day of the week) property, rather than .date (day of the month) property to set the new date. pickadate.js expects a day of the month integer value between 1-31 to set the date, while the day of the week values it is currently receiving are 0-6.

After changing both lines to .date, the year no longer changes when choosing months. Solves issue #485.

Plunk: https://plnkr.co/9rEH1FldEfNDxHbnqgof

andrewconnell commented 7 years ago

Manually merged