Set date when using Kendo date picker
-
- Posts: 5
- Joined: Tue Mar 25, 2014
I am trying to set the date programtically using a Kendo datetime picker but the date won't save. Is there a special trick to get this to work?
I am using moment.js and simply setting the date like this:
fd.field("CA1Date").value(moment().format());
The date shows up inside the Kendo datetime picker but when I save the form it doesn't save.
I am using moment.js and simply setting the date like this:
fd.field("CA1Date").value(moment().format());
The date shows up inside the Kendo datetime picker but when I save the form it doesn't save.
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi,
Try to pass a date object into the value method, ex.:
fd.field('FieldName').value(new Date());
Try to pass a date object into the value method, ex.:
fd.field('FieldName').value(new Date());
-
- Posts: 5
- Joined: Tue Mar 25, 2014
Thanks for the reply. Just tried that but still doesn't work. The value gets set in the textbox but isn't saved when saving the form. Is there any special functions that are called when using the Kendo Date Picker to make this work?
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi,
You're right, the issue is in our code. We will fix it soon. For now, use the following code to set kendo Date field:
You're right, the issue is in our code. We will fix it soon. For now, use the following code to set kendo Date field:
Code: Select all
fd.field('FieldName').control('kendoDatePicker').done(function(datePicker) {
datePicker.value(new Date());
datePicker.trigger('change');
});
-
- Information
-
Who is online
Users browsing this forum: No registered users and 4 guests