diff --git a/CHANGELOG.md b/CHANGELOG.md index 437c56eb..d3d32df6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ _Note: Gaps between patch versions are faulty, broken or test releases._ + * **Bug Fix** + * Add leading zero to hour & minute on `` when needed ([#314](https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/314) by [@mhxbe](https://github.com/mhxbe)) + ## 3.6.0 * **Improvement** diff --git a/src/utils.js b/src/utils.js index 2b579e54..f75cddbe 100644 --- a/src/utils.js +++ b/src/utils.js @@ -44,7 +44,7 @@ exports.getCurrentTime = function () { const year = time.getFullYear(); const month = MONTHS[time.getMonth()]; const day = time.getDate(); - const hour = time.getHours(); - const minute = time.getMinutes(); + const hour = `0${time.getHours()}`.slice(-2); + const minute = `0${time.getMinutes()}`.slice(-2); return `${day} ${month} ${year} at ${hour}:${minute}`; };