Skip to content

Commit

Permalink
Fix sort order of months correctly
Browse files Browse the repository at this point in the history
Closes #97
  • Loading branch information
ruchernchong committed Aug 23, 2024
1 parent e2632ab commit 3588b5e
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions app/components/MonthSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,15 @@ export const MonthSelect = ({ months, defaultMonth }: MonthSelectProps) => {
{sortedMonths.map(([year, months]) => (
<SelectGroup key={year}>
<SelectLabel>{year}</SelectLabel>
{months
.slice()
.reverse()
.map((month) => {
const date = `${year}-${month}`;
{months.slice().map((month) => {
const date = `${year}-${month}`;

return (
<SelectItem key={month} value={date}>
{formatDateToMonthYear(date)}
</SelectItem>
);
})}
return (
<SelectItem key={month} value={date}>
{formatDateToMonthYear(date)}
</SelectItem>
);
})}
</SelectGroup>
))}
</SelectContent>
Expand Down

0 comments on commit 3588b5e

Please sign in to comment.