Select to view content in your preferred language

Displaying time in Dashboard List

1222
3
10-18-2024 07:23 AM
Labels (1)
Boyang_Wang
Frequent Contributor

Hello,

I have two questions about displaying time in Dashboard List. Here is a screenshot of my List setting.

list.JPG

My questions are:

1. Why the time showing in Dashboard List is in a different time zone from my ArcGIS Pro? For example, if a feature has a date value of 10/30/2024 12am in Pro, it becomes 10/29/2024 8pm in Dashboard List. The service was published as hosted feature layer in ArcGIS Enterprise. The dashboard was also built in ArcGIS Enterprise.

2. How can I show only the date, not the time? I understand that in popup I can make a custom field using Text($feature.date_field,'MM/DD/YYYY'), but in Dashboard I don't think I can.

Thank you.

0 Kudos
3 Replies
jcarlson
MVP Esteemed Contributor

but in Dashboard I don't think I can.

Oh, but you can! Turn on Advanced Formatting in your list widget. Use an expression like this:

var action_date = Text($datapoint['action_date'], 'MM/DD/YYYY')
var dev_rev_date = Text($datapoint['dev_rev_date'], 'MM/DD/YYYY')
var submit_date = Text($datapoint['submit_date'], 'MM/DD/YYYY')

return {
  attributes: {
    action_date,
    dev_rev_date,
    submit_date
  }
}

(In your screenshot, you listed "dev_rev_date" twice, I guessed the third field was something different. Just adjust the field names as needed.)

Then in your list item template, you can access those attributes using {expression/attribute_name}.

Action Date: {expression/action_date}
Development Review Date: {expression/dev_rev_date}
Submission Date: {expression/submit_date}

Oh and for question #1: Pro doesn't automatically adjust the displayed / stored values for time zone unless you configure the layer / application settings to do so. The web interface, on the other hand, will always adjust the displayed and entered times for the device time zone.

- Josh Carlson
Kendall County GIS
Boyang_Wang
Frequent Contributor

Hi Josh,

I see in ArcGIS Online Dashboard that there is Advanced Formatting available, but my Enterprise Dashboard is an old version that doesn't have it. I'll fix my date display after upgrading my Enterprise. 

As to the time zone issue, I realize the problem is that I never set up the time zone when publishing feature service. If I have it set up correctly when publishing, it will display correctly in online map viewer. 

Thank you so much for providing the code example (and pointing out my typo in date field)!

0 Kudos
jcarlson
MVP Esteemed Contributor

So, you could also try going into the layer's visualization settings. You should be able to configure the field defaults so that the dates do not display time. That or you need to configure the setting in the map, if your dashboard is pulling its data from a map.

- Josh Carlson
Kendall County GIS
0 Kudos