Zero-pad months < 10

This is greasy, but it doesn't look like JS has a sprintf-alike
This commit is contained in:
Nick Pegg 2017-10-11 22:12:30 -07:00
parent b696005d89
commit e22f52b06d

View file

@ -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);