I set the format of my date in this way:
$('#filterdate').kendoDatePicker({format: "dd/MM/yyyy"});
SOMEWHERE I have code which set (#filterdate)
#filterdate is 10/7/2014
but when I use this code :
$('#filterdate').data("KendoDatePicker").value();
it returns : 10 Jun 2014
why the dates are different? its really strange. I think I have problem in initializing Kendo (maybe) .
parseFormats
(used when you set a date) and format
(used for displaying the date in the input box).$('#filterdate').data("KendoDatePicker").value();
where KendoDatePicker
is with lowercase K
, but since you say that it shows a date instead of complaining by an undefined, it is fine.Said so, if you initialize the DatePicker as:
var fd = $("#filterdate").kendoDatePicker({
parseFormats:["dd/MM/yyyy"],
format: "dd/MM/yyyy"
}).data("kendoDatePicker");
it works perfectly fine, both setting and getting a date as:
Setting:
fd.value("10/7/2014");
and Getting:
var value = fd.value();
Check it running here: http://jsfiddle.net/OnaBai/5q1tnh1j/