Unexpected Behavior on <md-datepicker> With YYYY-MM-DD Format
While working with the datepicker component to see which formats are accepted as valid date formats I found this behavior. When using the text input to enter a date in yyyy-mm-dd format it will roll the date back 1 day. So if you type 2016-04-05 into the input this will result in 4/4/2016 being displayed.
https://plnkr.co/edit/Vb43PW
I couldn't reproduce it. It showed up as 4/5/16 for me.
This is a pickle then because I am at a loss as to what is different on my end that could be causing this because this also happens on the demo.
http://i.imgur.com/2J97hT5.gifv
The date from the view gets passed through the parseDate method on the $mdDateLocaleProvider before it gets assigned to the modal. You can override this method if you want more control over what gets inserted. You can read more about it in the docs.
This happens when your timezone is under GMT and YYYY-MM-DD is the ISO 8601. So the browser will interpret it as the date you entered(Month Day Year 00:00:00) minus the difference of hours of the timezone. I still believe its an issue in datepicker.