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

Fix Sitemap timestamp format #15229

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
Expand Down Expand Up @@ -74,15 +73,15 @@ private async Task<bool> BuildUrlsetMetadataAsync(ContentTypesSitemapSource sour

private async Task<bool> BuildExtendedMetadataAsync(SitemapBuilderContext context, ContentItemsQueryContext queryContext, ContentItem contentItem, XElement url)
{
var suceeded = true;
var succeeded = true;
foreach (var sc in _sitemapContentItemExtendedMetadataProviders)
{
if (!await sc.ApplyExtendedMetadataAsync(context, queryContext, contentItem, url))
{
suceeded = false;
succeeded = false;
}
}
return suceeded;
return succeeded;
}

private async Task<bool> BuildUrlAsync(SitemapBuilderContext context, ContentItem contentItem, XElement url)
Expand Down Expand Up @@ -162,7 +161,7 @@ private static void PopulateLastMod(ContentItem contentItem, XElement url)
if (contentItem.ModifiedUtc.HasValue)
{
var lastMod = new XElement(_namespace + "lastmod");
lastMod.Add(contentItem.ModifiedUtc.GetValueOrDefault().ToString("yyyy-MM-ddTHH:mm:sszzz"));
lastMod.Add(contentItem.ModifiedUtc.GetValueOrDefault().ToString("yyyy-MM-ddTHH:mm:sszzz", CultureInfo.InvariantCulture));
url.Add(lastMod);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why it doesn't respect the current culture?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I respects the current culture, that's the issue. Check the issue linked issue.

}
}
Expand Down
Loading