Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to update ListItem with DateTime property #1488

Open
1 task done
kavrat opened this issue Jun 20, 2024 · 1 comment
Open
1 task done

Unable to update ListItem with DateTime property #1488

kavrat opened this issue Jun 20, 2024 · 1 comment
Assignees
Labels
area: model 📐 Related to the core SDK models question Further information is requested

Comments

@kavrat
Copy link

kavrat commented Jun 20, 2024

Category

  • Bug

Describe the bug

I'm trying to update a listitem with the DateTime property with a new value in UTC format, but I got an error:

Exception: System.ArgumentException: Unknown timezone mapping
[2024-06-20T15:19:08.619Z] at PnP.Core.Model.SharePoint.TimeZone.GetTimeZoneInfoFromSharePoint(Int32 timeZoneId)
[2024-06-20T15:19:08.619Z] at PnP.Core.Model.SharePoint.TimeZone.UtcDelta(DateTime dateTime)
[2024-06-20T15:19:08.620Z] at PnP.Core.Model.SharePoint.TimeZone.UtcToLocalTime(DateTime dateTime)
[2024-06-20T15:19:08.621Z] at PnP.Core.Model.SharePoint.ListItem.DateTimeToSharePointWebDateTimeString(PnPContext context, DateTime input)
[2024-06-20T15:19:08.622Z] at PnP.Core.Model.SharePoint.ListItem.BuildValidateUpdateItemPayload(PnPContext context, KeyValuePair2 changedProp, Object field) [2024-06-20T15:19:08.622Z] at CallSite.Target(Closure, CallSite, ListItem, PnPContext, KeyValuePair2, Object)
[2024-06-20T15:19:08.623Z] at PnP.Core.Model.SharePoint.ListItem.BuildUpdateApiCallAsync(PnPContext context)
[2024-06-20T15:19:08.624Z] at PnP.Core.Model.SharePoint.ListItem.BaseUpdate(Func2 fromJsonCasting, Action1 postMappingJson)
[2024-06-20T15:19:08.625Z] at PnP.Core.Model.BaseDataModel`1.UpdateAsync()

TimeZone of SharePoint site - (UTC-12:00 International Date Line West)
Locale - German

Expected behavior

ListItem should be updated as expected

Environment details (development & target environment)

  • SDK version: 1.12
  • OS: Windows 11
  • SDK used in: Azure Functions
  • Framework: .NET 8.0
  • Tooling:Rider IDE
@jansenbe jansenbe self-assigned this Jul 26, 2024
@jansenbe
Copy link
Contributor

@kavrat : I've tried to reproduce this but am failing to do so. Can you show the code you use to update the ListItem? Do you seen the same issue on with other timezones/languages as well?

@jansenbe jansenbe added question Further information is requested area: model 📐 Related to the core SDK models labels Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: model 📐 Related to the core SDK models question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants