chore: fix dev site dates to iso format (#3949)

This commit is contained in:
Erez Rokah 2020-06-25 18:28:23 +03:00 committed by GitHub
parent 5d710dbd69
commit 8982b57854
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -55,11 +55,12 @@
var date = new Date();
date.setTime(date.getTime() + ONE_DAY);
var dateString = '' + date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
var month = ('0' + (date.getMonth()+1)).slice(-2)
var dateString = '' + date.getFullYear() + '-' + month + '-' + date.getDate();
var slug = dateString + "-post-number-" + i + ".md";
window.repoFiles._posts[slug] = {
content: "---\ntitle: \"This is post # " + i + `\"\ndraft: ${i % 2 === 0}` + "\ndate: " + dateString + "T00:99:99.999Z\n---\n\n# The post is number " + i + "\n\nAnd this is yet another identical post body"
content: "---\ntitle: \"This is post # " + i + `\"\ndraft: ${i % 2 === 0}` + "\ndate: " + dateString + "T00:00:00.000Z\n---\n\n# The post is number " + i + "\n\nAnd this is yet another identical post body"
}
}

View File

@ -55,11 +55,12 @@
var date = new Date();
date.setTime(date.getTime() + ONE_DAY);
var dateString = '' + date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();
var month = ('0' + (date.getMonth()+1)).slice(-2)
var dateString = '' + date.getFullYear() + '-' + month + '-' + date.getDate();
var slug = dateString + "-post-number-" + i + ".md";
window.repoFiles._posts[slug] = {
content: "---\ntitle: \"This is post # " + i + `\"\ndraft: ${i % 2 === 0}` + "\ndate: " + dateString + "T00:99:99.999Z\n---\n\n# The post is number " + i + "\n\nAnd this is yet another identical post body"
content: "---\ntitle: \"This is post # " + i + `\"\ndraft: ${i % 2 === 0}` + "\ndate: " + dateString + "T00:00:00.000Z\n---\n\n# The post is number " + i + "\n\nAnd this is yet another identical post body"
}
}