DatePicker TwoWay-Binding CultureInfo

The sdk:DatePicker seems to have an issue when the value entered need to be bound back to the data container.

When showing a value, the current culture info is used. When binding back, always en-US is used. Accordingly, entering the 31st of December fails to bind back, and the 3rd of February is converted to the 2nd of March.

To get the correct value when bound back, one needs to set the language of the DatePicker containing control to the current language.

Language = XmlLanguage.GetLanguage(CultureInfo.CurrentCulture.Name);

Setting the language in the ctor of the main page saves a lot of work 🙂

Leave a Comment

Please note that every comment requires the admin's approval before it will be published.

Any comment containing spam like "... great topic. Feel free to visit my web page ..." will be deleted. So please do not waste your and our time by leaving such comments.

We respect your privacy. When you leave a comment, your IP address will not be recorded by WordPress.