Skip to content

Commit

Permalink
fix TimeFilter date formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
incognitojam committed Jul 8, 2023
1 parent 2e11851 commit bfac8ce
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/components/AppHeader/TimeFilter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,12 @@ class TimeSelect extends Component {

lastWeekText() {
const weekAgo = dayjs().subtract(1, 'week');
return `Last Week${weekAgo.format('M/D')} - ${dayjs().format('M/D')})`;
return `Last Week (${weekAgo.format('MMM D')} - ${dayjs().format('MMM D')})`;
}

last2WeeksText() {
const twoWeeksAgo = dayjs().subtract(14, 'day');
return `2 Weeks Ago (${twoWeeksAgo.format('M/D')} - ${dayjs().format('M/D')})`;
}

last24HoursText() {
return 'Last 24 Hours';
return `2 Weeks Ago (${twoWeeksAgo.format('MMM D')} - ${dayjs().format('MMM D')})`;
}

onVisible() {
Expand All @@ -182,7 +178,7 @@ class TimeSelect extends Component {
className={classes.headerDropdown}
>
<MenuItem value="custom">Custom</MenuItem>
<MenuItem value="24-hours">{ this.last24HoursText() }</MenuItem>
<MenuItem value="24-hours">Last 24 Hours</MenuItem>
<MenuItem value="1-week">{ this.lastWeekText() }</MenuItem>
<MenuItem value="2-weeks">{ this.last2WeeksText() }</MenuItem>
</Select>
Expand Down

0 comments on commit bfac8ce

Please sign in to comment.