Skip to content

Commit

Permalink
feat: date formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
ekoeryanto committed Oct 20, 2019
1 parent d6f3ca8 commit 84fb4f0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module.exports = (options, context) => {
outFile = 'sitemap.xml',
changefreq = 'daily',
exclude = [],
dateFormatter = (lastUpdated) => new Date(lastUpdated).toISOString(),
...others
} = options

Expand Down Expand Up @@ -63,7 +64,7 @@ module.exports = (options, context) => {
}

const lastmodISO = page.lastUpdated
? new Date(page.lastUpdated).toISOString()
? dateFormatter(page.lastUpdated)
: undefined
const { normalizedPath } = stripLocalePrefix(page.path, localeKeys)
const relatedLocales = localesByNormalizedPagePath.get(normalizedPath)
Expand Down

0 comments on commit 84fb4f0

Please sign in to comment.