Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
delphiactual committed Jun 11, 2024
1 parent 30f1e02 commit 4659635
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/generate-season-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -318,20 +318,20 @@ function formatDateDDMMMYYYY(dateString: string, dayBefore = false) {
if (dayBefore) {
date.setUTCDate(date.getUTCDate() - 1);
}
return date
return date // This should return a date as 15SEP2024
.toLocaleString('en-GB', {
day: '2-digit',
month: 'short',
year: 'numeric',
timeZone: 'UTC',
})
.toUpperCase()
.replace(/\s/g, '')
.replace(/\s/g, '') // Remove spaces
.replace(/SEPT/, 'SEP'); // September is abbreviated with 4 letters instead of 3 for some reason
}

function generateBestGuessEndDate(seasonNumber: number) {
const numWeeks = 12;
const numWeeks = 16; // As of TFS seasons/episodes are 4 months instead of 3
const resetTime = D2SeasonInfo[seasonNumber].resetTime.endsWith('Z') // Ensure TZ attached to DT stamp
? D2SeasonInfo[seasonNumber].resetTime
: `${D2SeasonInfo[seasonNumber].resetTime}Z`;
Expand Down

0 comments on commit 4659635

Please sign in to comment.