Creating allDay events fails

Hi support,
I'm using the scheduler with the following settings:

let scheduleObj = new ej.schedule.Schedule({
width: '100%',
height: '700px',
rowAutoHeight: true,
allowDragAndDrop: true,
firstDayOfWeek: 1,
timezone: 'Europe/Berlin',
dateHeaderTemplate: dateHeaderTemplate,
agendaDaysCount: 365,
hideEmptyAgendaDays: true,
views: [
{option: 'Month', displayName: '<?=Yii::t('app', 'Overview Weeks')?>', interval: 12},
],
group: {
allowGroupEdit: true,
resources: []
},
.....

If I try to create a single event with the allDay Option set, I get the following strange errors 
Please analyze the data sent to the backend:

Error 1
Create a new event with "allDay" Option set:
from 20.01.2021 to 20.01.2021
does send to the server
{"changed":[],"added":[{"Subject":"Test1","StartTime":"2021-01-19T23:00:00.000Z","EndTime":"2021-01-20T23:00:00.000Z","IsAllDay":true,"StartTimezone":null,"EndTimezone":null,"resourceid":[11,2],"RecurrenceRule":null,"Id":"8820e487-3deb-9acc-2a9b-689c0c0a8e72"}],"deleted":[],"action":"batch",
so this events now spans two days rather than one

Updating the above created event to a single day event in setting the start day to 20.01.2021 changes the end date automatically to 21.01.2021 at the request
Updating the above created event to a single day event in setting the end day to 20.01.2021 changes the start day automatically to 19.01.2021 at the request

Error 2
Create new event with "allDay" Option set:
from 20.01.2021 to 21.02.2021
does send to the server
{"changed":[],"added":[{"Subject":"Test1","StartTime":"2021-01-19T23:00:00.000Z","EndTime":"2021-01-21T23:00:00.000Z","IsAllDay":true,"StartTimezone":null,"EndTimezone":null,"resourceid":[11,2],"RecurrenceRule":null,"Id":"fa151cbc-8b7a-94cc-2978-2297af9b8f51"}],"deleted":[],"action":"batch",


As you can see the start time is set to the day before and a time of 23:00:00 is set. 

I know that there is a strange pattern to set the end date to the following day (this comes from outlook). 
But then the parameters of error1 have to be StartTime: "2021-01-20T00:00", EndTime: 2021-01-21T00:00. This is not the case here (see above)
I can't handle this in the background.

What can I do?

Regards,
Stephan









1 Reply 1 reply marked as answer

HB Hareesh Balasubramanian Syncfusion Team January 18, 2021 10:55 AM UTC

Hi Stephan, 

We have validated you shared snippets and query at our end and suspect that your requirement is switch the StartTime and EndTIme fields to the corresponding next dates but by default when we enable the IsAllDay field then the time of the StartTime/EndTime will be switched to the 12:00 AM of the corresponding dates, so in your shared date the StartTime will be considered as (19/01/2021) and EndTime will be considered as (20/01/2021). And for the same, we have prepared a sample with the shared data, which can be viewed from the following link. 


data = [ 
  { 
    Id: 1, 
    Subject: "Meeting", 
    StartTime: new Date(2021, 0, 19, 23, 0), 
    EndTime: new Date(2021, 0, 20, 23, 0), 
    IsAllDay: true 
  } 
]; 
var scheduleObj = new ej.schedule.Schedule({ 
  height: "650px", 
  currentView: "Month", 
  eventSettings: { dataSource: data } 
}); 
scheduleObj.appendTo("#Schedule"); 

Kindly try the above solution and if we misunderstand your requirement, kindly share us more details like the use case scenario/image/video demo of your requirement of your requirement, in order to give the prompt solution at our end. 

We will be happy to assist you. 

Regards, 
Hareesh 


Marked as answer
Loader.
Up arrow icon