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 Sep 5, 2024. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
calendar: doesn't handle timezone from ng-model-options #10431
This is a huge issue for our application, and I don't know any workaround besides "don't use angular-md". I don't expect it to get fixed, though, considering the bug is probably considered something of a "feature" at this point. Would break old applications that rely on the bug...
I ended up writing a custom directive amending the returned date, to use within md-calendar. It's a good workaround (imho 😄 ), but I still think the bug has to be fixed.
Nice! I ended up writing a component (that doesn't rely on moment, although I think moment is probably unnecessary with your approach as well)
(function(){'use strict';angular.module('app.widgets').component('datePicker',{templateUrl: 'path/to/template.html',controller: DatePickerController,bindings: {minDate: '<?',maxDate: '<?',required: '<?',placeholder: '<?',currentView: '<?',name: '<?',initialDate: '<?',onChange: '&',ariaLabel: '<?'}});functionDatePickerController(){varvm=this;if(!vm.initialDate){vm.date=null;}else{// outer date is UTC// convert to local timvm.date=newDate(vm.initialDate.getTime()+60000*vm.initialDate.getTimezoneOffset());}vm.update=update;functionupdate(date){// inner date is local time// convert to UTC to pass back upvarutcDate=newDate(date.getTime()-60000*date.getTimezoneOffset());vm.onChange({date: utcDate});}}}());
@gaby64 I haven't had a chance to get back to this. I've been focused on P1 issues. If you want to submit a PR to fix this, I would be happy to review it and try to get it merged.
changed the title [-]md-calendar: doesn't handle timezone from ng-model-options[/-][+]calendar: doesn't handle timezone from ng-model-options[/+]on Aug 31, 2019
Activity
[-]mdCaledar doesn't care of timezone[/-][+]mdCalendar doesn't care of timezone[/+]rivertam commentedon Mar 28, 2017
This is a huge issue for our application, and I don't know any workaround besides "don't use angular-md". I don't expect it to get fixed, though, considering the bug is probably considered something of a "feature" at this point. Would break old applications that rely on the bug...
simonered commentedon Mar 29, 2017
I ended up writing a custom directive amending the returned date, to use within md-calendar. It's a good workaround (imho 😄 ), but I still think the bug has to be fixed.
rivertam commentedon Mar 29, 2017
Nice! I ended up writing a component (that doesn't rely on moment, although I think moment is probably unnecessary with your approach as well)
I'm a React fan so I reached for the component when I saw this problem.
Splaktar commentedon Jan 5, 2018
I can see the difference in behavior and it needs to be fixed. I've updated the CodePen for 1.1.5 and the issue is still there.
[-]mdCalendar doesn't care of timezone[/-][+]md-calendar: doesn't handle timezone from ng-model-options[/+]23 remaining items
gaby64 commentedon Aug 26, 2019
any progress?
gaby64 commentedon Aug 27, 2019
@Splaktar
works for me
Splaktar commentedon Aug 29, 2019
@gaby64 I haven't had a chance to get back to this. I've been focused on P1 issues. If you want to submit a PR to fix this, I would be happy to review it and try to get it merged.
fix issue angular#10431
[-]md-calendar: doesn't handle timezone from ng-model-options[/-][+]calendar: doesn't handle timezone from ng-model-options[/+]feat(calendar): support specifying timezone in ng-model-options
Splaktar commentedon May 12, 2020
Opened PR 🧙♂️ #11906 ✨ for this issue.
feat(calendar): support specifying timezone in ng-model-options
feat(calendar): support specifying timezone in ng-model-options