mirror of
https://github.com/gabehf/Koito.git
synced 2026-04-22 20:11:50 -07:00
fix rewind default page
This commit is contained in:
parent
9678117c05
commit
925c308552
3 changed files with 11 additions and 7 deletions
|
|
@ -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() };
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue