Add explanations to relative dates

This commit is contained in:
shamoon
2023-05-08 22:08:22 -07:00
parent 3ab2892066
commit 0e9642ea3e
4 changed files with 36 additions and 16 deletions

View File

@@ -39,20 +39,24 @@ export class DateDropdownComponent implements OnInit, OnDestroy {
relativeDates = [
{
date: RelativeDate.LAST_7_DAYS,
id: RelativeDate.LAST_7_DAYS,
name: $localize`Last 7 days`,
date: new Date().setDate(new Date().getDate() - 7),
},
{
date: RelativeDate.LAST_MONTH,
id: RelativeDate.LAST_MONTH,
name: $localize`Last month`,
date: new Date().setMonth(new Date().getMonth() - 1),
},
{
date: RelativeDate.LAST_3_MONTHS,
id: RelativeDate.LAST_3_MONTHS,
name: $localize`Last 3 months`,
date: new Date().setMonth(new Date().getMonth() - 3),
},
{
date: RelativeDate.LAST_YEAR,
id: RelativeDate.LAST_YEAR,
name: $localize`Last year`,
date: new Date().setFullYear(new Date().getFullYear() - 1),
},
]