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

Updating lastmod date string format to match W3C spec #3

Merged
merged 2 commits into from
Jan 4, 2017

Conversation

omardelarosa
Copy link
Contributor

Issue

The lastUpdate value sets single digit day and month values. For example, today would be 2017-1-3 in the xml sitemap output. This causes sitemaps to be invalid on certain search engines, such as Google.

Solution

The sitemaps.org protocol mentions that the <lastmod> tag should work as such:

The date of last modification of the file. This date should be in W3C Datetime format. This format allows you to omit the time portion, if desired, and use YYYY-MM-DD.

Description

  • Change just adds options to the GenerateDate function's call to toLocaleDateString that should output the correct, Goolge-friendly format now. 😄

@schneidmaster
Copy link
Owner

Hey @omardelarosa, good catch & thanks for the PR. Would you mind also bumping the package.json version to 0.1.2 & then I'll merge and release?

@schneidmaster schneidmaster merged commit 753c08d into schneidmaster:master Jan 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants