From 2290fe591b67e6333df89220fe48ff9fee2a28af Mon Sep 17 00:00:00 2001 From: Abderahman88 Date: Thu, 3 Dec 2020 02:04:23 +0100 Subject: [PATCH] fix all-day event --- samples/react-calendar/README.md | 3 +++ samples/react-calendar/config/package-solution.json | 2 +- samples/react-calendar/src/services/spservices.ts | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/samples/react-calendar/README.md b/samples/react-calendar/README.md index 22567ccd0..0f0a40f36 100644 --- a/samples/react-calendar/README.md +++ b/samples/react-calendar/README.md @@ -113,6 +113,7 @@ Calendar Web Part|João Mendes Calendar Web Part|Mohamed Derhalli Calendar Web Part (Upgrade)|Hugo Bernier ([@bernier](https://twitter.com/bernierh), [Tahoe Ninjas](https://tahoeninjas.blog/)) Calendar Web Part|Nanddeep Nachan ([@NanddeepNachan](https://twitter.com/NanddeepNachan)) +Calendar Web Part|Abderahman Moujahid ## Version history @@ -123,6 +124,8 @@ Version|Date|Comments 1.0.2|April 25, 2020|Update styles according to the applied theme 1.0.3|June 06, 2020|Upgrade to SPFx 1.10.0 1.0.4|October 18, 2020|Added support for all-day events +1.0.5|October 21, 2020|Added Year view +1.0.6|December 3, 2020|Fixed all-day events (#1623) ## Disclaimer diff --git a/samples/react-calendar/config/package-solution.json b/samples/react-calendar/config/package-solution.json index f84532de5..406edd09a 100644 --- a/samples/react-calendar/config/package-solution.json +++ b/samples/react-calendar/config/package-solution.json @@ -3,7 +3,7 @@ "solution": { "name": "react-calendar-client-side-solution", "id": "3a13208b-3874-4036-9262-4edd22e88187", - "version": "1.0.5.0", + "version": "1.0.6.0", "includeClientSideAssets": true, "skipFeatureDeployment": true, "isDomainIsolated": false diff --git a/samples/react-calendar/src/services/spservices.ts b/samples/react-calendar/src/services/spservices.ts index 6a1438d96..7c3aa1c92 100644 --- a/samples/react-calendar/src/services/spservices.ts +++ b/samples/react-calendar/src/services/spservices.ts @@ -503,7 +503,7 @@ export default class spservices { const CategoryColorValue: any[] = categoryColor.filter((value) => { return value.category == event.Category; }); - const isAllDayEvent: boolean = event.fAllDayEvent === "Yes"; + const isAllDayEvent: boolean = event["fAllDayEvent.value"] === "1"; for (const attendee of event.ParticipantsPicker) { attendees.push(parseInt(attendee.id)); @@ -515,8 +515,8 @@ export default class spservices { EventType: event.EventType, title: await this.deCodeHtmlEntities(event.Title), Description: event.Description, - EventDate: isAllDayEvent ? new Date(moment(event.EventDate).toISOString()) : new Date(moment(event.EventDate).subtract((siteTimeZoneHours), 'hour').toISOString()), - EndDate: isAllDayEvent ? new Date(moment(event.EndDate).toISOString()) : new Date(moment(event.EndDate).subtract(siteTimeZoneHours, 'hour').toISOString()), + EventDate: isAllDayEvent ? new Date(event.EventDate.slice(0, -1)) : new Date(moment(event.EventDate).subtract((siteTimeZoneHours), 'hour').toISOString()), + EndDate: isAllDayEvent ? new Date(event.EndDate.slice(0, -1)) : new Date(moment(event.EndDate).subtract(siteTimeZoneHours, 'hour').toISOString()), location: event.Location, ownerEmail: event.Author[0].email, ownerPhoto: userPictureUrl ?