Skip to content

Commit

Permalink
fix: pads date numbers in changelog automation (#862)
Browse files Browse the repository at this point in the history
  • Loading branch information
krpeacock committed Mar 19, 2024
1 parent ccd0e4d commit a926850
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 29 deletions.
6 changes: 5 additions & 1 deletion bin/roll-changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ if (!newVersion) {
process.exit(1);
}
const now = new Date();
const formattedDate = `${now.getFullYear()}-${now.getMonth() + 1}-${now.getDate()}`;
const padNumber = (num: number) => num.toString().padStart(2, '0');

const formattedDate = `${now.getFullYear()}-${padNumber(now.getMonth() + 1)}-${padNumber(
now.getDate(),
)}`;

const path: string = 'docs/CHANGELOG.md';
const pattern: string = '## [Unreleased]';
Expand Down
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Changed

* fix: pads date numbers in changelog automation. E.G. 2024-3-1 -> 2024-03-01
* feat: allow passing `DBCreateOptions` to `IdbStorage` constructor

## [1.1.1] - 2024-03-19
Expand Down
56 changes: 28 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a926850

Please sign in to comment.