Is there a way to control the display of a date field of a FeatureDataForm ?
At the moment it is displayed in a US format ( M/D/Y ) which would be nice to change to lets say d/m/y.
Hey,
Data form should you your UICulture / PrimaryLanguageOverride to define how it's shown. Here is how FeatureDataForm looks on my comp with en-GB locale
And here with fi-FI locale
What locale you are using or are you planning to show it in different format that your locale is usually using?
My local is set to en-Au
And what I would expect is that the date would be 30/10/2014 but instead I get 10/30/2014.
The validation of a Date field actually respects that and forces me to input it as it should be in my locale.
However when you apply your changes and go back to the FeatureDataFrom then its displayed incorrectly.
It seems that my previous comment was incorrect. Localization is driven by Language attribute, which is how WPF controls handles the localization.
ie.
<toolkit:FeatureDataForm Language="en-AU" ApplyCompleted="MyDataForm_ApplyCompleted" />
If you want to set application level language definition to correspond you UI Culture you can do this at startup of the application
FrameworkElement.LanguageProperty.OverrideMetadata(typeof(FrameworkElement), new FrameworkPropertyMetadata(XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.IetfLanguageTag)));
Some resources to read more about this issue :
Thanks for you help.
It is interesting that the validation is done using my Language while the display is not.
Creating a simple wpf app and adding a date time field displays fine without the need to set/change anything. So not sure why I need to do so for the toolkit.
In both cases the CultureInfo is en-AU while the cultureUIInfo is en-us.
Forcing a specific language does not sound right to me so the only option is to set the language at startup so that it respects user settings.
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.