jQuery UI Widgets › Forums › Scheduler › Not recognizing dates correctly
Tagged: javascript scheduler, jquery scheduler, jqwidgets scheduler, scheduler
This topic contains 3 replies, has 2 voices, and was last updated by Hristo 6 years ago.
I have the following appointment:
var appointment1 = { id: "2", description: "", location: "", subject: "CHILI", calendar: "Room 1", start: new Date(2018, 08, 20, 13, 0, 0), end: new Date(2018, 08, 20, 16, 0, 0) }
The scheduler shows it on September instead of August. I added the file for globalization to US but that did not work.
Hello CXXXV,
This is a correct behavior. It becomes from the Date object where the months start from 0.
Date
0
Best Regards, Hristo Hristov
jQWidgets team http://www.jqwidgets.com
So everytime when storing I have to subtract a month and add one when retrieving. That’s dumb. How can I set up scheduler to do that automatically.
Yes, you could use our format option provided with the DataAdapter’s source – { name: 'start', type: 'date', format: 'yyyy/MM/dd hh:mm' } Please, take a look at this example.
{ name: 'start', type: 'date', format: 'yyyy/MM/dd hh:mm' }
You must be logged in to reply to this topic.