From e22f52b06d17a98f1ecfaa34eeb6c494de2989b9 Mon Sep 17 00:00:00 2001 From: Nick Pegg Date: Wed, 11 Oct 2017 22:12:30 -0700 Subject: [PATCH] Zero-pad months < 10 This is greasy, but it doesn't look like JS has a sprintf-alike --- src/Article.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Article.js b/src/Article.js index 56aa75a..7e09b85 100644 --- a/src/Article.js +++ b/src/Article.js @@ -46,6 +46,10 @@ class Article extends Component { let year = date.getUTCFullYear(); let month = date.getUTCMonth() + 1; + if (month < 10) { + month = '0' + month.toString(); + } + let slug = this.props.article.slug; if (!slug) { slug = slugify(this.props.article.title);