-
Notifications
You must be signed in to change notification settings - Fork 3.4k
mdDatepicker: Not updated correctly with ng-model-options timezone #9989
Comments
I've been playing with this, it looks like we're just not refreshing the model often enough. I'm going to dig into it. |
@topherfangio I'm also experiencing problems since I updated to 1.1.4. My timezone is UTC+1 but I'm using the datepicker with ng-model-options={ timezone: 'UTC' } because I want to get only the date part (I'm not interested in the time). After closing the picker I get 1 day less than the value I picked... There's a similar issue here: |
Any update on this? I am using Angular 2 and need this to be fixed for production. |
@cristiandonati can you provide a little more detail on how I am supposed to use the CodePen to reproduce the issue? I updated the CodePen for AngularJS Material 1.1.5 and the behavior seems to be the same to me, but I'm not exactly sure how to reproduce the issue based on your description. I do notice that when changing the date with the input, the time does not change. But when changing the date with the md-datepicker via the panel or input, it resets the time to 12am. This happens with AngularJS Material 1.1.0, but not with 1.1.5. If that was the issue, then I can close this as fixed, but I am not 100% clear if that was the issue based upon your description and the CodePen. |
@Splaktar the issue was that the first value shown in the input was calculated based on the UTC time zone and not based on the time zone set in the ngModelOptions. |
@cristiandonati excellent, thank you. The datepicker currently respects |
Actual Behavior:
What is the issue? *
Using md-datetime with ng-model-options="{timezone: '-0500'}", shown value is not updated in accordance with the time zone like Input component.Not updated correctly
<md-datepicker ng-model="myDate" ng-model-options="{timezone:myDateTimeZone}"></md-datepicker>
Updated correctly
<input type="date" ng-model="myDate" ng-model-options="{timezone:myDateTimeZone}" />
Setting the date using the md-datepicker, the value is set properly.
CodePen (or steps to reproduce the issue): *
CodePen Demo which shows your issue:
http://codepen.io/anon/pen/woKwbbAngular Versions: *
Angular Version:
1.5.8Angular Material Version:
1.1.0The text was updated successfully, but these errors were encountered: