You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using PNP.powershell and SharePointPnPPowerShell2016 to copy a SharePoint 2016 calendar to a SharePoint Online list. I'm encountering two strange issues.
The first issue is that if create a new list item using add-pnplistitem and use the source lists's $CalendarEntry.FieldValues.EventDate and $CalendarEntry.FieldValues.EndDate values, the times appear off by the UTC-5:00 offset in the destination list, but only if $CalendarEntry.FieldValues.fAllDayEvent -eq $true on the source list. If $CalendarEntry.FieldValues.fAllDayEvent -eq $false then the times come over just fine. I was able to work around this by calculating the difference between localtime and utc and using .addhours() to correct the times, but this seems like a workaround for a bug.
The second issue is that if I use New-PnPBatch, the AM and PM values become inverted on the newly created list items. This seems to affect all new list items where the source item was an all-day event, and only some other events randomly. For example, when adding a list item with EventDate = 12:00 am and EndDate = 11:59 pm, the new SharePoint list shows EventDate = 12:00 pm and EndDate = 11:59 am. Check out the examples below.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I'm using PNP.powershell and SharePointPnPPowerShell2016 to copy a SharePoint 2016 calendar to a SharePoint Online list. I'm encountering two strange issues.
The first issue is that if create a new list item using add-pnplistitem and use the source lists's $CalendarEntry.FieldValues.EventDate and $CalendarEntry.FieldValues.EndDate values, the times appear off by the UTC-5:00 offset in the destination list, but only if $CalendarEntry.FieldValues.fAllDayEvent -eq $true on the source list. If $CalendarEntry.FieldValues.fAllDayEvent -eq $false then the times come over just fine. I was able to work around this by calculating the difference between localtime and utc and using .addhours() to correct the times, but this seems like a workaround for a bug.
The second issue is that if I use New-PnPBatch, the AM and PM values become inverted on the newly created list items. This seems to affect all new list items where the source item was an all-day event, and only some other events randomly. For example, when adding a list item with EventDate = 12:00 am and EndDate = 11:59 pm, the new SharePoint list shows EventDate = 12:00 pm and EndDate = 11:59 am. Check out the examples below.
Here's a screenshot of a few items on the source list

Here's the destination list when running this without batch

Here's the destination list when running this with batch

Am I doing something wrong? Did I find a bug of some sort? I'm pretty new to scripting so any help I can get would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions