Skip to content

Commit

Permalink
Merge pull request #314 from mhxbe/bugfix/page-title-hours-minutes
Browse files Browse the repository at this point in the history
Add leading zero to hour & minute on <title /> when needed
  • Loading branch information
valscion committed Oct 17, 2019
2 parents c95df99 + 2596783 commit 7cefb58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -14,6 +14,9 @@ _Note: Gaps between patch versions are faulty, broken or test releases._

<!-- Add changelog entries for new changes under this section -->

* **Bug Fix**
* Add leading zero to hour & minute on `<title />` when needed ([#314](https://github.com/webpack-contrib/webpack-bundle-analyzer/pull/314) by [@mhxbe](https://github.com/mhxbe))

## 3.6.0

* **Improvement**
Expand Down
4 changes: 2 additions & 2 deletions src/utils.js
Expand Up @@ -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}`;
};

0 comments on commit 7cefb58

Please sign in to comment.