This is a migrated thread and some comments may be shown as answers.

DateTimePicker incorrect format for general date 'g'

3 Answers 294 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Pawel
Top achievements
Rank 1
Pawel asked on 24 Nov 2017, 12:21 PM

Hi,
We are using Kendo UI controls for ASP.NET MVC and we are in the middle of updating the kendo libraries (from version 2016.1.112 to 2017.3.1018). One of the things that have changed is how the DateTimePicker is displaying dates. We are using the 'g' specifier to display dates according to the user's culture. Previously for Polish culture ('pl-PL') the date was displayed as 'yyyy-MM-dd HH:mm' - now it is displayed as 'dd.MM.yyyy HH:mm' (with dots and in different order).

The problem besides the date being displayed in the incorrect format is that when the form is send to the server, the date cannot be parsed and bound to a correct DateTime object ('The value '24.11.2017 00:00' is not valid for Current date.' error).

Could you tell us how to get this working as it did previously?

3 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 28 Nov 2017, 07:42 AM
Hello, Pawel,

I can assume that the format was changed after an advice from the community that this is the correct Polish date format. If this is not correct please let us know:

https://en.wikipedia.org/wiki/Date_and_time_notation_in_Poland

Also, the dates could be parsed on the server before trying to save them to ensure that they will be in the valid format.

If additional assistance is needed, please provide a fully runnable example and I will gladly provide a suggestion best suited for the implementation.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Frank
Top achievements
Rank 1
answered on 24 Jul 2018, 10:26 AM
Hello Stefan,

we are using Telerik UI for ASP.NET MVC (version 2017.3.1026) and have the same issue.
In your linked wikipedia article it's stated that "The authorities changed the order of the date stamps in 1979 to follow Polish industrial standard PN-90/N-01204 (Polskie Normy) similar to ISO 8601; 1981-12-13 has been the preferred format since then. ".

So it seems the Kendo Control is indeed using the wrong format.
Even if the community would request it, I don't see the logic behind changeing it, because if Kendo UI uses another datetime format as .NET does, it just breaks the built in model serialization of ASP.NET MVC.

Has this issue already been resolved in any newer version of Telerik UI for ASP.NET MVC? And if not, in which version will it be resolved.
0
Stefan
Telerik team
answered on 25 Jul 2018, 07:11 AM
Hello, Frank,

Thank you for the feedback.

The change is currently not made as this is advised to be the new format for that culture. Still, if this is causing issues on the server we will discuss reverting to the old format.

In the meantime please check the following article demonstrating how the culture file can be manually changed in order to use the desired format:

https://docs.telerik.com/kendo-ui/framework/globalization/definecultureinfo

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Date/Time Pickers
Asked by
Pawel
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Frank
Top achievements
Rank 1
Share this question
or