Skip to content

Commit

Permalink
Merge branch 'mmi/TimeZoneIdSupportForCreateSiteAsync' of https://git…
Browse files Browse the repository at this point in the history
  • Loading branch information
jansenbe committed Aug 31, 2023
2 parents af2b932 + 0976d03 commit b3054b5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/lib/PnP.Framework/Sites/SiteCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ public static async Task<ClientContext> CreateAsync(
{
payload.Add("PreferredDataLocation", siteCollectionCreationInformation.PreferredDataLocation.Value.ToString());
}
if (siteCollectionCreationInformation.TimeZoneId.HasValue)
{
payload.Add("TimeZoneId", siteCollectionCreationInformation.TimeZoneId.Value);
}

return await CreateAsync(clientContext, siteCollectionCreationInformation.Owner, payload, delayAfterCreation, noWait: noWait);
}
Expand Down Expand Up @@ -192,6 +196,10 @@ public static async Task<ClientContext> CreateAsync(
payload.Add("SensitivityLabel", sensitivityLabelId);
payload["Classification"] = siteCollectionCreationInformation.SensitivityLabel;
}
if (siteCollectionCreationInformation.TimeZoneId.HasValue)
{
payload.Add("TimeZoneId", siteCollectionCreationInformation.TimeZoneId.Value);
}
return await CreateAsync(
clientContext,
siteCollectionCreationInformation.Owner,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,11 @@ public bool AllowFileSharingForGuestUsers
/// </summary>
public Enums.Office365Geography? PreferredDataLocation { get; set; }

/// <summary>
/// The time zone to use for the site.
/// </summary>
public int? TimeZoneId { get; set; }

public SiteCreationInformation()
{
}
Expand Down

0 comments on commit b3054b5

Please sign in to comment.