Skip to content

Commit

Permalink
fixing the script
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomas-Gallant committed Dec 9, 2024
1 parent 3fb6538 commit ba054bd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions .github/scripts/get-current-date.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ function getDaySuffix(day) {
return "th";
}
}
const utcDate = new Date().toLocaleString("en-US", { timeZone: 'America/New_York' });

const date = new Date(new Date().toLocaleString("en-US", { timeZone: 'America/New_York' }));
const date = new Date(utcDate);
const monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
const day = date.getDate();
console.log(date.toLocaleString('en-US', { timeZone: 'America/New_York', timeZoneName: 'short' }));
console.log(utcDate);
const suffix = getDaySuffix(day);
const formattedDate = `${monthNames[date.getMonth()]} ${day}${suffix}, ${date.getFullYear()}`;
await $`echo "DATE=${formattedDate}" >> $GITHUB_OUTPUT`;
Expand Down

0 comments on commit ba054bd

Please sign in to comment.