Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
19
rated 0 times [  22] [ 3]  / answers: 1 / hits: 80941  / 10 Years ago, sat, august 16, 2014, 12:00:00

I want to set today date to Kendo DatePicker on clear button click. I tried following but it is not working.



$('#btnClear').click(function () {
$(#StartDate).data(kendoDatePicker).value(new Date());
});


Above code don't give any error and don't set today date. It clears kendo DatePicker's textbox value.
Note: Kendo DatePicker format is MM/dd/yyyy.


More From » jquery

 Answers
33

I tried following and works perfectly for me.



$('#btnClear').click(function () {
var todayDate = kendo.toString(kendo.parseDate(new Date()), 'MM/dd/yyyy');
$(#StartDate).data(kendoDatePicker).value(todayDate);
});

[#69762] Thursday, August 14, 2014, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
daytonm

Total Points: 519
Total Questions: 83
Total Answers: 89

Location: Saudi Arabia
Member since Mon, Sep 5, 2022
2 Years ago
;