I'm trying to add a new item to the kendo scheduler.
My database columnNames for the start and end are "TimeStart" and "TimeEnd"
These columns have datetime formats.
In the scheduler I use the following lines to read the items from the database.
When I create a new item, I set the TimeStart and TimeEnd to the chosen values.
But, because it's a custom insert form, I use:
Before adding the item to this function, the dates are properly added to the object.
When I do another console.log() in the create function, the dates are suddenly changed to the current date/time.
My create function is just like this:
Why does the dataSource.add() function reset all my dates?
note: I've tested this with another field in my database "CreatedDate", which has no "from" attribute in the fields configuration.
It turns out that this object doesnt change, when I set it, but when I leave it empty, Kendo will fill it also with the current Date/Time
Thanks in advance!
My database columnNames for the start and end are "TimeStart" and "TimeEnd"
These columns have datetime formats.
In the scheduler I use the following lines to read the items from the database.
start: { type: "date", from: "TimeStart" },
end: { type: "date", from: "TimeEnd" },
When I create a new item, I set the TimeStart and TimeEnd to the chosen values.
But, because it's a custom insert form, I use:
$("#Scheduler").data().kendoScheduler.dataSource.add(newItem);
Before adding the item to this function, the dates are properly added to the object.
When I do another console.log() in the create function, the dates are suddenly changed to the current date/time.
My create function is just like this:
create: function (e) { console.log(e); }
note: I've tested this with another field in my database "CreatedDate", which has no "from" attribute in the fields configuration.
It turns out that this object doesnt change, when I set it, but when I leave it empty, Kendo will fill it also with the current Date/Time
Thanks in advance!