-
Notifications
You must be signed in to change notification settings - Fork 838
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
Timezones matching the current system timezone #55
Comments
Yeah, I think user timezone detection would make sense to add to moment-timezone. In the meantime though, you should check out https://bitbucket.org/pellepim/jstimezonedetect which will probably solve your use case. |
I think this would be a very useful addition. But do consider that time zone detection is messy and error prone. Especially, consider that we would need to provide updates periodically to account for the ECMAScript 5.1 15.9.1.8 issue. Note that jsTimeZoneDetect has the same problem. |
👍 |
Cool, was about to ask exact this question. I've also included https://bitbucket.org/pellepim/jstimezonedetect into my project to do some kind of this stuff here var locale = moment.tz(date, $rootScope.defaultTimeZone).locale('de');
return locale.tz($rootScope.timezone).calendar(); So 👍 Would be a very big nice to have instead of relying again to another 3rd party solution. |
+1 |
I opened a PR for this at #220. |
This has been released in |
Nice 👍 |
Hello,
I need to know which timezones match the current system timezone, in order to do some date format manipulation on server side.
Few apis exists for this feature, and it is not a simple because in javascript we need to deal with timezone offset and test multiple dates.
However this thread on stackoverflow talks about this feature using moment timezone datas : http://stackoverflow.com/questions/19420582/detect-the-id-of-the-current-user-timezone-using-moment-js
I could simply used this peace of code but it can be certainly improve and why not include in moment timezone library.
The person that post this peace of code test the current date, the dates 4 and 8 months later and the same three dates five years before.
Is it a good strategy ? Can I improve it to have closer timezones matching ?
I need this feature so I can improve this peace of code with your advices and, if you're agreed, publish it in your repository.
The text was updated successfully, but these errors were encountered: