Skip to content

Commit 37ea2b4

Browse files
docs: use a less ambiguous date format for 'Last updated' (#944)
1 parent 1fe6b43 commit 37ea2b4

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/.vuepress/config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,21 @@ module.exports = {
461461
}
462462
},
463463
plugins: [
464+
[
465+
'@vuepress/last-updated',
466+
{
467+
transformer(timestamp) {
468+
const date = new Date(timestamp)
469+
470+
const digits = [
471+
date.getUTCFullYear(), date.getUTCMonth() + 1, date.getUTCDate(),
472+
date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds()
473+
].map(num => String(num).padStart(2, '0'))
474+
475+
return '{0}-{1}-{2}, {3}:{4}:{5} UTC'.replace(/{(\d)}/g, (_, num) => digits[num])
476+
}
477+
}
478+
],
464479
[
465480
'@vuepress/pwa',
466481
{

0 commit comments

Comments
 (0)