TerriaJS / terriajs

A library for building rich, web-based geospatial data platforms.
https://terria.io
Apache License 2.0
1.19k stars 364 forks source link

Add timezone override trait #6817

Closed sixlighthouses closed 9 months ago

sixlighthouses commented 1 year ago

add trait to allow users to specify if datetimes are in UTC -- when the date attributes have no timezone

Related ticket https://app.zenhub.com/workspaces/terriajs-all-57511fce8d1d8954514d40d1/issues/gh/terriajs/product/285

sixlighthouses commented 1 year ago

draft PR https://github.com/TerriaJS/terriajs/pull/6822

image
staffordsmith83 commented 1 year ago

UPDATE 19 July 2023: Staf and crispy to finish review.

nf-s commented 1 year ago

I don't think we should be modifying dates coming from web services. If services don't specify timezone in dates - then we assume UTC.

If users want to see dates as UTC instead of local timezone (which is the default web browser behaviour), then they can use the following trait.

{
    "dateFormat": "UTC:dd/mm/yyyy, HH:MM:ss Z"
{

If needed, we can revisit this if we come across "local" datasources than need a timezone adjustment (for example CSVs)

nf-s commented 9 months ago

I'm going to close this - as the problem this was trying to solve ended up being a opendatacube-ows problem

Context - https://github.com/TerriaJS/terriajs/discussions/6968