indrimuska / angular-moment-picker

Angular Moment Picker is an AngularJS directive for date and time picker using Moment.js.
http://indrimuska.github.io/angular-moment-picker/
MIT License
527 stars 229 forks source link

momentDate set timezone #249

Open rajithwijepura opened 6 years ago

rajithwijepura commented 6 years ago

Hi, is there a way to set timezone for the momentDate? I'm in GMT+5.30.

Thanks

reidark commented 6 years ago

Yes, to set "literally" a timezone, you need the "tz" method (additional) from moment,js. Documentation: https://momentjs.com/timezone/docs/

csimpi commented 5 years ago

I have the same problem right now. The users can pick their birthday. The user picks the date, the model value will be set the selected date with time (00:00:00) and timezone so when I send it to my database the day will be one less than hat I've sent. I'm in GMT the server is in UTC, so that's why. I can fix this by handling the date as a string instead of a date object so the timezone won't be changed, but this shouldn't be the right way to store the sent data. I would like to overwrite that, the default timezone is the client's timezone, I would like to force a static timezone instead. How can I do that through angularjs?

Thank you