Update angular-moment-picker to use a different time zone

267 Views Asked by At

I'm using angular-moment-picker with moment-tz and it correctly uses the time zone originally set, but when I change the time zone for the model, the picker changes back to the local time zone of the browser instead of the time zone on the model.

I thought that maybe I could regenerate the component when a different time zone is selected, but so far I haven't got it to work. I don't know how to refresh angular-moment-picker to pick up the new time zone in the moment-tz object.

If I select a time by using the datepicker control, the next time I open it, it uses the correct time zone. However, changing the time zone in the moment-tz object causes the datepicker control to use the local time zone until a new time is selected. If I could somehow trick the datepicker into thinking a new time had been selected, that should fix the problem in theory.

I've written a custom component to render the datepicker and different time zones to choose. However, the controller for the component seems to be ignorant of the fact that its HTML rendering has a datepicker in it.

0

There are 0 best solutions below