So basically, the event changes from single day to multi-day. The problem is that I have to actually refresh my browser for the event to be rendered correctly, otherwise the scheduler still shows it as a single-day event. Is there a way to successfully update the scheduler when the state of an event changes from single-day to multi-day?
Hi, I am using the set event date functions, but getting the following error:
ev.start_date.getDate is not a function
on line 5616 in dhtmlxscheduler_debug.js
"var delta = ev.end_date.getDate()-ev.start_date.getDate(); "
Actually, start_date and end_date are both Javascript timestamps and this particular object does have methods (my bad sorry) but it doesnāt really matter since getDate doesnāt exists anyway. You can check out Date objectās complete API here if you want:
As for me modifying the degug.js, I havenāt touched it, getEventEndDate and getEventStartDate are both part of the schedulerās base API, you can check it here:
Be sure that you have used date objects, not strings for setStartDate and setEndDate methods ( setters doesnāt convert strings to dates automatically )
That was part of my problem - it resolved the issue I had in my simple individual event test case, but Iām back to events updated in this if statement (else if (temp.action == ārecurring_updateā)) disappearing after the updateEvent callā¦
Have you checked whether your events are still in your database and if so, what happened to their data? And also, if your events are multi days, you have to include this line in the init() function somewhere:
scheduler.config.multi_day = true;
Also, have you tried your code with these lines instead:
var start = scheduler.getEventStartDate(temp.ids[i]);
var end = scheduler.getEventEndDate(temp.ids[i]);
The string you give to scheduler.date.str_to_date has to accurately match the format itās written in. So if your date is in format āYmd Hiā, your string should reflect that. So in essence, if you want things to work accurately, you should change
var revert = scheduler.date.str_to_date("%Y-%m-%d %H:%i");
and put this instead:
var revert = scheduler.date.str_to_date("%Y%m%d %H%i");
Otherwise, just use the getEventStartDate and getEventEndDate functions, they already return a Date object so you wouldnāt have to use the revert variable anymore.
I noticed the issue with my date format and changed it to match the date string Iām passing, but Iām still getting an invalid date.
I canāt use getEventStartDate because the Iām trying to update the date of events based on data I am pulling from my database, not based on what the calendar already knows.
Have you tried creating a function that reformats your date string by inserting the ā-ā and ā:ā at the right places and subsequently passing this string to the revert variable? This might work a little better.
20110125 1330
You will need to create a custom function or change format of data
The date conversion methods expects that group of digits will be separated by any chars and canāt split the numeric group in few separate values