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

Date parse error when setting time

1 Answer 48 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Alan Mosley
Top achievements
Rank 1
Alan Mosley asked on 14 Jan 2015, 05:05 PM
I am trying to set the time of a date picker to 1 hour later but keep getting an error, (only when adding hour)
Date.prototype.addHours = function (h) {
    this.setTime(this.getTime() + (h * 60 * 60 * 1000));
    return this;
}   
 
var d = new Date(e.event.start)
            d.addHours(1)
            $("#endx").kendoDateTimePicker({
                value: d
            });

I keep getting an error here in kendo.all.js line 1477
if (value && value.indexOf("/D") === 0) {
Where value is a number, and does not support indexOf

Thanks
‚Äč

1 Answer, 1 is accepted

Sort by
0
Alan Mosley
Top achievements
Rank 1
answered on 14 Jan 2015, 05:59 PM
OK I solved it,
it should have been
value: new Date(d)
Thanks
Tags
Date/Time Pickers
Asked by
Alan Mosley
Top achievements
Rank 1
Answers by
Alan Mosley
Top achievements
Rank 1
Share this question
or