Skip to content

Commit 7cefb58

Browse files
authored
Merge pull request #314 from mhxbe/bugfix/page-title-hours-minutes
Add leading zero to hour & minute on <title /> when needed
2 parents c95df99 + 2596783 commit 7cefb58

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ _Note: Gaps between patch versions are faulty, broken or test releases._
1414

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

17+
* **Bug Fix**
18+
* 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))
19+
1720
## 3.6.0
1821

1922
* **Improvement**

src/utils.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ exports.getCurrentTime = function () {
4444
const year = time.getFullYear();
4545
const month = MONTHS[time.getMonth()];
4646
const day = time.getDate();
47-
const hour = time.getHours();
48-
const minute = time.getMinutes();
47+
const hour = `0${time.getHours()}`.slice(-2);
48+
const minute = `0${time.getMinutes()}`.slice(-2);
4949
return `${day} ${month} ${year} at ${hour}:${minute}`;
5050
};

0 commit comments

Comments
 (0)