Hi,
I have a DatePicker that displays the date nicely in the correct format i.e. "2016-05-26" for May 26, 2016.
I would like to handle badly formatted user input, like "160531" which is an allowed way to enter a date in our organisation. I want to take this date and format it correctly with some JS code. The problem is that when I input a date like this I can't get it from the datepicker in my javascript code.
JS Code:
var date1 = kendo.toString($("#RelevantDate").data("kendoDatePicker").value(), 'd');
var date2 = $("#RelevantDate").data("kendoDatePicker").value();
both the date1 and the date2 variable are null if I have a date like "160531". With a nicely formatted date everything works.
Is there any way to get a badly formatted date out of the datepicker? I want the users to be able to select the date in the picker and to enter the date manually so changing to a textbox input is not an option.
Best regards,
Henrik