Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moment.js loses timezone information. #9

Open
s-maheshbabu opened this issue Feb 9, 2015 · 2 comments
Open

Moment.js loses timezone information. #9

s-maheshbabu opened this issue Feb 9, 2015 · 2 comments

Comments

@s-maheshbabu
Copy link

When a Moment object is used for ng-model instead of a Date object, the timezone information set on the moment is lost.
The code is using a moment's underlying Date object which doesn't contain any timezone information.

If supporting moment.js, I think it is important to retain timezone information or at least call out in the documentation that timezone information will be lost.

http://plnkr.co/edit/BqBS59XvZlH5KMbulTgQ?p=preview

@timmipetit
Copy link
Member

Thanks for the bug report, this indeed seems to be a problem. Actually, there are 2 problems:

  • formatting the timepicker. We currently rely on formatting options from jquery-timepicker, which expects a Date object
  • returning a proper moment-with-timezone object when the user selects a time in the timepicker.

@timmipetit
Copy link
Member

I think that for now we won't support moment.js with timezone information (unless someone writes a pull request: we're up for that). Ideally I'd like jquery-timepicker to support moment.js (with timezones), so that this codebase only serves as a thin wrapper between the timepicker and Angular

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants