Skip to content

Commit

Permalink
Add current week
Browse files Browse the repository at this point in the history
  • Loading branch information
GODrums committed Sep 27, 2024
1 parent 35b4703 commit 355eaa9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions webapp/src/app/home/leaderboard/filter/filter.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ export class LeaderboardFilterComponent {
constructor(private router: Router) {
// get monday - sunday of last 4 weeks
const options = new Array<SelectOption>();
const now = dayjs();
let currentDate = dayjs().day(1);
options.push({
id: now.unix(),
value: `${currentDate.format('YYYY-MM-DD')}.${now.format('YYYY-MM-DD')}`,
label: `${currentDate.format('MMM D')} - ${now.format('MMM D')}`
});
for (let i = 0; i < 4; i++) {
const newDate = currentDate.subtract(7, 'day');
options.push({
Expand Down

0 comments on commit 355eaa9

Please sign in to comment.