React-calendar-timeline: Request: Better documentation on use in different timezones

Created on 9 Apr 2017  路  4Comments  路  Source: namespace-ee/react-calendar-timeline

I'm trying to make a timetable for a festival. But I'm having issues converting the view to the right timezone (+2GMT). Anyone got a working timezone example? Should I format my input UNIX to the timezone (+2GMT)? Or use a standard and change the zone using moment.locale() ?

documentation help wanted question

All 4 comments

Hi, I believe you should use moment-timezone.

something like this:

import moment from 'moment-timezone'
moment.tz.setDefault(timezone)

items = [
  {
    start: moment(startTime).valueOf(),
    end: moment(endTime).valueOf(),
  }
]

<Timeline items={items} ... />

@mariusandra @kevinmeyvaert timezones and localisation seams to be recurring question. I think I should write a few words in the readme. Can you point me, what the problem for localisation here was? what are common problems?

@signalwerk it would be great to get some more clarity on what @mariusandra has posted above. Ideally a demo showing the timeline in UTC using moment-timezone would be the ultimate. To be completely conclusive, having the demo interactive with choosing a custom timezone would probably cover everything

To whomever wants to take this, you could create a codesandbox using this as a starting point then add a section to the examples/README.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pvtran1995 picture pvtran1995  路  6Comments

riflemanIm picture riflemanIm  路  3Comments

stahlmanDesign picture stahlmanDesign  路  4Comments

mdrulis-neurosys picture mdrulis-neurosys  路  7Comments

forki picture forki  路  5Comments