palantir / plottable

:bar_chart: A library of modular chart components built on D3
http://plottablejs.org/
MIT License
2.97k stars 224 forks source link

Configurable UTC/local-time #3432

Closed waltonseymour closed 6 years ago

waltonseymour commented 6 years ago

This PR allows for Plottable.Formatters.time to display dates in UTC in addition to local time with the addition of an optional boolean useUTC.

This flag is also passed down from the TimeAxis constructor which also contains the additional useUTC flag.

For us, this solves a business requirement of displaying time in UTC without having to modify the underlying Date objects, which has a number of drawbacks.

themadcreator commented 6 years ago

Other than my comments, this changes looks good to me. Thanks!

waltonseymour commented 6 years ago

I've updated the PR to address comments. I've also corrected an issue with tickInterval where the ticks would be generated with local time while the labels would reflect UTC time.