Date format for DateTime field in Editor Widget

992
2
Jump to solution
01-17-2022 11:33 PM
ZA1
by
New Contributor III

Hi,

A feature I am using in Editor widget has a DateTime attribute 

By default the Date/Time fields are in the format of: mm/dd/yyyy

Instead, I need it to be: dd/mm/yyyy

I do not know how to do this change. 

ZA1_0-1642490975106.png

But preferably, when the user clicks the date field a calendar should appear to select a day.

Any help would be greatly appreciated.

 

Thanks!

 

0 Kudos
1 Solution

Accepted Solutions
HeatherGonzago
Esri Contributor

Hi, thanks for asking about this. Unfortunately, there is no direct and easy way to set this right now in the FeatureForm (and hence the Editor since this uses the FeatureForm widget). We are actively working on making this easier for all widgets that make use of dates and will hopefully have a better way to handle this in an upcoming release.

For now, formatting for dates in the FeatureForm is taken directly by the browser. If you're browser's locale was set to "en-GB", the format would flip to dd/mm/yyyy. I realize that this is not the answer you were looking to get. We do hope to make this easier in the near future.

View solution in original post

2 Replies
HeatherGonzago
Esri Contributor

Hi, thanks for asking about this. Unfortunately, there is no direct and easy way to set this right now in the FeatureForm (and hence the Editor since this uses the FeatureForm widget). We are actively working on making this easier for all widgets that make use of dates and will hopefully have a better way to handle this in an upcoming release.

For now, formatting for dates in the FeatureForm is taken directly by the browser. If you're browser's locale was set to "en-GB", the format would flip to dd/mm/yyyy. I realize that this is not the answer you were looking to get. We do hope to make this easier in the near future.

ZA1
by
New Contributor III

Thanks for the response @HeatherGonzago, appreciated. 

Unfortunately, there is no direct and easy way to set this right now


As a non-direct way, perhaps:

  1. Hide the original date field in the form
  2. Insert a new input field with the date configuration that I want 
  3. When the user clicks "Add", in the background I replace the date in (1) with (2) 

Could I ask you if you can think of a better approach?

0 Kudos