diff --git a/generators/base/support/timestamp.ts b/generators/base/support/timestamp.ts index e4163746fd81..648a857daa31 100644 --- a/generators/base/support/timestamp.ts +++ b/generators/base/support/timestamp.ts @@ -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.`);