Skip to content

Commit

Permalink
clean it up even more
Browse files Browse the repository at this point in the history
  • Loading branch information
delphiactual committed Jun 10, 2024
1 parent 045f6af commit 30f1e02
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/generate-season-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,10 +318,16 @@ function formatDateDDMMMYYYY(dateString: string, dayBefore = false) {
if (dayBefore) {
date.setUTCDate(date.getUTCDate() - 1);
}
const day = date.toLocaleString('en-US', { day: '2-digit', timeZone: 'UTC' });
const year = date.toLocaleString('en-US', { year: 'numeric', timeZone: 'UTC' });
const month = date.toLocaleString('en-US', { month: 'short', timeZone: 'UTC' }).toUpperCase();
return `${day}${month}${year}`;
return date
.toLocaleString('en-GB', {
day: '2-digit',
month: 'short',
year: 'numeric',
timeZone: 'UTC',
})
.toUpperCase()
.replace(/\s/g, '')
.replace(/SEPT/, 'SEP'); // September is abbreviated with 4 letters instead of 3 for some reason
}

function generateBestGuessEndDate(seasonNumber: number) {
Expand Down

0 comments on commit 30f1e02

Please sign in to comment.