Default: the user's current timeZone as provided by the browser. Intl.DateTimeFormat().resolvedOptions().timeZone
For KPI, Status, make sure the bottom timestamp displayed on the widget reflects the updated timezone
For resource explorer, ensure that all places which display timestamps of data as a result of searches, reflects the timezone offset.
For XY Plot, ensure the bottom timestamp displayed reflects the timezone offset, the data point tooltip, as well as the X-Axis labels, and the timestamps shown within the legend and the trend cursor column headers.
Expected API behavior
When timeZone is undefined, use browser timeZone.
When timeZone is "America/Denver", The date should be display in Mountain Daylight Time (GMT-6).
### Acceptance criteria
- [ ] Timezone support added in KPI / Status
- [ ] Timezone support in XY Plot
- [ ] Timezone support in resource explorer
This task is to add timezone support for the shared widgets of IoT App Kit.
Add a new optional property,
timeZone?: string;
. This will be used to format dates into a different timezone than the where the one the user is in.Implementation details: We want to use https://date-fns.org/ to format dates.
How to handle timezones in echarts - https://github.com/apache/echarts/issues/14453
How to handle dates in our React components -
Default: the user's current timeZone as provided by the browser.
Intl.DateTimeFormat().resolvedOptions().timeZone
For KPI, Status, make sure the bottom timestamp displayed on the widget reflects the updated timezone
For resource explorer, ensure that all places which display timestamps of data as a result of searches, reflects the timezone offset.
For XY Plot, ensure the bottom timestamp displayed reflects the timezone offset, the data point tooltip, as well as the X-Axis labels, and the timestamps shown within the legend and the trend cursor column headers.
Expected API behavior
timeZone
is undefined, use browser timeZone.timeZone
is "America/Denver", The date should be display in Mountain Daylight Time (GMT-6).