Hello everyone,
I have a table with a date field that I am using on list widget and the default date format is adding a Time stamp to the date value. Does anyone know how to remove the time from the output? Can I use arcade to re-format the date data field to read mm/dd/yyyy? Thanks for any suggestions!
JB
I believe that comes from the default popup/attribute settings for the layer. If you go to the item's Visualization tab and adjust the attribute formatting in the popup settings, it should carry through to the dashboard.
Alternatively, if your dashboard is pulling its information from a Web Map, you can configure the popup attribute formatting in the web map.
Thank you Josh for your suggestion!
The date field is part of a related table ( no map or pop up to configure) and there are no options to configure the table fields other than using arcade. I think!!
JB
Ah, yes. I've run into that problem myself. What you'd need to do is use something like AGO Assistant to view and edit the JSON of the map or the feature layer, and you can update the attribute formatting there.
Not sure why , but I can't not even see the associated tables on AGO assistant. I can see the (JSON) layer but not the associated tables or fields. It is frustrating that something that simple takes so much effort to edit.
JB
Not a real solution to the problem, but a way to go around was creating a new TEXT field and copy the data from the DATE field (Using Pro). I use the new TEXT field for the list widget.
Is there a way to fix this in an Online environment?
If you don't need the field to be a DATE type, you can create a new STRING field in AGOL and use the calculate/arcade to parse just the date:
Text($feature.REPDATE, 'MM/DD/YYYY')
You can use Arcade in advanced formatting in Dashboard in the "Values" tab to format the date. For example if I have a field VisitDate and I want to remove the timestamp.
var visit = Day($datapoint.VisitDate) + '/' +(Month($datapoint.VisitDate)+1) + '/' + Year($datapoint.VisitDate)
return {
cells: {
VisitDate: {
displayText: visit,
hoverText: $datapoint.VisitDate,
textColor: '',
backgroundColor: '',
textAlign: 'right'
},
n