-
Notifications
You must be signed in to change notification settings - Fork 78
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
Add support for local timezone #71
base: master
Are you sure you want to change the base?
Conversation
thanks for your contribution, @tantra35. Much appreciated. Timezone support is definitely nice to have. I'm not sure I fully understand this change however. And more importantly - would it change the default timezone to all users to use their local time in their browser? because this might not be desirable for all users (myself included). So I'd love to add timezone support, but don't want to force any new timezone on users (other than the default that graphite returns, which I believe is UTC). Could you explain how this works and whether or not this will have the effect? |
For now there no parameter, that define timezone, and it is locale depend toLocaleString(); - return time str is locale depended format It is possible to make custom parameter that allow redefine locale timezone. Also to check thats all work, its simply to launch patched version. But i check UTC and Moskow time, and on my opinion all works |
I tested it on my browser, and it distorts the time. Perhaps my browser isn't set correctly, but I'm getting American dates (I normally use European date format), time with AM/PM (I prefer 24 hour format), and there's no indication of the timezone the data is displayed at, which I think is very important. So if we were to implement timezone / localization I think it needs to be:
I guess it's possible to pass things over, and only override the default? |
You mean that distorts time format? Time zone is simple thift in hours. For example if UTC time is 11:00, then MSK time is +3 = 14:00 If mean only time format then yes i aggree with you that needed aditional config variable that defines time format, or define locales, but in giraffe d3.locale doesn't defined |
Yes, it's mainly about the formatting which isn't explicit, configurable or clear. The way it works now (for me at least) is that the format makes sense and it shows me GMT so I know which time zone the data is displayed for. After applying your change it switched to my local time zone but the format didn't indicate it + wasn't the format I expected or that seems to match my locals settings (I never use American dates). But it's also about the time zone. I might be in Europe (UTC +1), but prefer my dashboard to show time in UTC... So if you can fix the formatting, make it optional (the default time zone and format should stay the same), and allow tweaking the time zone, it would be great. Otherwise it changes things too much in an unexpected and non configurable way right now. |
Ok now exists 2 custom variables graphite_timezone - to setup timezone offset, by default "Etc/UTC" For "out-of-box" instalation we include huge moment-with-locales.js, but it can be customized by users, as moment(http://momentjs.com/) describes |
this looks much better, thanks! I still have a few problems / questions:
|
No description provided.