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

Kendo DateTimePicker will not take a different format

1 Answer 76 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 03 Feb 2015, 08:17 PM

Hi,

I am trying to set a default value of today in my datetimepicker.  However, it will not allow me to change the date time format from "Tue Feb 3 13:54:54 EST 2015" format which I an unable to convert in the c# code.  Here is my javascript code:
var startDateString = '';
$("#start-date-datepickerId").kendoDateTimePicker({
value: new Date(),
change:
function () {
startDateString = kendo.toString(
this.value());
},
 
format: "0:MM/dd/yyyy"
 
});

if (startDateString == '')

startDateString = kendo.parseDate($("#start-date-datepickerId").data("kendoDateTimePicker").value());

Any and all help is appreciated

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 05 Feb 2015, 11:14 AM
Hi Daniel,

Setting an initial value is indeed done through the value option, as in the example you shared. I am not exactly sure what is the expected behavior, however I would recommend supplying a format parameter for the toString method.

Regards,
Alexander Popov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Date/Time Pickers
Asked by
Daniel
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or