Merge pull request #1626 from Abderahman88/AllDaysFix

Thank you @Abderahman88. This is a great fix!
This commit is contained in:
Hugo Bernier 2020-12-03 00:52:20 -05:00 committed by GitHub
commit 36aba947f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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 ?