fix rewind default page

This commit is contained in:
Gabe Farrell 2026-01-12 23:08:31 -05:00
parent 9678117c05
commit 925c308552
3 changed files with 11 additions and 7 deletions

View file

@ -19,12 +19,12 @@ const getRewindYear = (): number => {
return new Date().getFullYear() - 1;
};
const getRewindParams = (): string => {
const getRewindParams = (): { month: number; year: number } => {
const today = new Date();
if (today.getMonth() == 0) {
return `year=${today.getFullYear() - 1}`;
return { month: 0, year: today.getFullYear() - 1 };
} else {
return `month=${today.getMonth()}`;
return { month: today.getMonth(), year: today.getFullYear() };
}
};