Esri / Esri/solution.js

Add support for preferredTimeReference property on Feature Services

Open
#897 3 comments 0 reactions 1 assignee Claimed by @jmhauck View on GitHub
Dominant language
TypeScript
Stars
48
Forks
16
PR merge metrics
No merged PRs in 30d

Description

In ArcGIS Online and Enterprise services all dates are stored in UTC. In web clients these dates are always converted to local time based on the browser timezone. In ArcGIS Pro this doesn't happen automatically, it will display in UTC by default. A new option was added to ArcGIS Online and Enterprise hosted services called preferredTimeReference that ArcGIS Pro honors when display date fields. This blog post discusses setting this option:

https://www.esri.com/arcgis-blog/products/arcgis-pro/mapping/working-with-agol-feature-services-date-time-attributes-in-non-utc-time-zone-in-arcgis-pro-2-7.

I would like to propose 2 things, we support the ability to specify this timezone at the root of the properties object of a feature service template like below. All layers in a service need to have the same preferredTimeReference and you specify it at the service level via updateDefinition and then it is pushed to all the layers in the service. If we find this property set on a layer and not null, we should pull it to the root of the properties upon creation of the template.

![image](https://user-images.githubusercontent.com/6796763/193680724-023b063f-2c2d-4741-aabb-20aa877028e3.png)

During deployment we need to apply this in an updateDefinition on the service after all the layers are added.

In addition, I would like to replace the preferredTimeReference value with a variable that we can swap out at runtime during deployment:

"preferredTimeReference": {{localTimeZone}}

This variable should be replaced with the local time zone of the browser that is deploying the solution. From the blog above the list of valid time zones comes from this Microsoft topic:

https://learn.microsoft.com/en-us/previous-versions/windows/embedded/ms912391(v=winembedded.11)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.