Skip to content

Commit

Permalink
Update timestamp.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Sep 23, 2024
1 parent 252d948 commit 440ea34
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions generators/base/support/timestamp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ export function parseChangelog(changelogDate: string): Date {
if (changelogDate.length !== 14) {
throw new Error(`changelogDate ${changelogDate} is not a valid changelogDate.`);
}
const formattedDate = `${changelogDate.substring(0, 4)}-${changelogDate.substring(4, 6)}-${changelogDate.substring(
6,
8,
)}T${changelogDate.substring(8, 10)}:${changelogDate.substring(10, 12)}:${changelogDate.substring(12, 14)}+00:00`;
const year = changelogDate.substring(0, 4);
const month = changelogDate.substring(4, 6);
const day = changelogDate.substring(6, 8);
const formattedDate = `${year}-${month}-${day}T${changelogDate.substring(8, 10)}:${changelogDate.substring(10, 12)}:${changelogDate.substring(12, 14)}+00:00`;
const parsedTimestamp = Date.parse(formattedDate);
if (isNaN(parsedTimestamp)) {
throw new Error(`changelogDate ${changelogDate} is not a valid date.`);
Expand Down

0 comments on commit 440ea34

Please sign in to comment.