Open joefutrelle opened 12 years ago
This is my diff from timeline v2.2.1:
< // JMF modified this line to use toISOString to render the date, because
< // the GBMF OII apps all use UTC. See top of the file for change rationale.
< // August 31, 2012
< dom.currentTime.title = "Current time: " + nowOffset.toISOString();
---
> dom.currentTime.title = "Current time: " + nowOffset;
+1 for @josdejong idea to integrate moment.js.
Time zone support is one of the most required feature for us. And the moment.js looks great! Like it +1.
But how can we set a time zone in moment.js like "Europe/Berlin"?
WallTime lib. looks good for me https://github.com/sproutsocial/walltime-js
But how can we set a time zone in moment.js like "Europe/Berlin"?
Do you want to display dates in another time zone than the local time zone?
User should choose his preferred time zone. In 99% cases this is his / her local time zone. Time zone on server can differ from the local time zone of course.
To be honest, I don't care about the time zone stuff because we wrapped this great Timeline widget in an JSF (JavaServer Faces) component which provide a "timeZone" attribute. So, we convert dates with given time zone in Java before Timeline displaying. The more important thing is internationalization (i18n) because AFAIK it's hardcoded in the widget and we can not customize text in an easy way.
moment.js comes with i18n, so that should be solved more or less automatically when switching to moment.js :)
Ah ok, you are right. Does it also mean, when user add a new event, he / she will see an I18N text "New" as content of the new event? :-)
well, that is what I meant with "more or less automatically", as there are still some other text messages in the Timeline which must be localized too.
Moment.js solves the problem of localized date formatting, but it does not solve the Europe/Berlin stuff yet. Javascript does not have "format datetime to string" built-in function, thus something like moment.js is required. https://github.com/timrwood/moment/issues/482#issuecomment-15093627 says full timezone support in moment.js is very close.
must be localized too
Full localization is a plus, but for readonly scenarios "New" buttons do not matter.
My app uses UTC times exclusively; always a PITA in Javascript. I found that I had to hack timeline.js to get the tooltip on the current time to show UTC instead of locale time. IWBNI this was configurable so you could inject a time format when creating the timeline?