Fix All Day event issue

Fix All Day event issue that makes All Day events date expanded to another day instead of being full day event.
This commit is contained in:
mohammadamer 2021-11-22 21:18:49 +02:00 committed by GitHub
parent 21783987a0
commit 563e5ba024
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 10 deletions

View File

@ -52,21 +52,13 @@ export default class parseRecurrentEvent {
return str.split(' ');
}
public parseDate(date: any, allDay: any) {
if (typeof date == 'string') {
if (allDay) {
if (date.lastIndexOf('Z') == date.length - 1) {
const dt = date.substring(0, date.length - 1);
return new Date(dt);
}
}
else {
return new Date(date);
}
return new Date(date);
}
return date;
}
public parseEvent(e: any, start: any, end: any) {
if (e.fRecurrence == '0' || e.fRecurrence == '4') {
e.EventDate = new Date(this.parseDate(e.EventDate, e.fAllDayEvent));