fix(dashboard): add weekly interval #154
This commit is contained in:
@@ -37,6 +37,10 @@ export function OverviewInterval() {
|
||||
value: 'day',
|
||||
label: 'Day',
|
||||
},
|
||||
{
|
||||
value: 'week',
|
||||
label: 'Week',
|
||||
},
|
||||
{
|
||||
value: 'month',
|
||||
label: 'Month',
|
||||
|
||||
@@ -62,6 +62,15 @@ export function ReportInterval({
|
||||
value: 'day',
|
||||
label: 'Day',
|
||||
},
|
||||
{
|
||||
value: 'week',
|
||||
label: 'Week',
|
||||
disabled:
|
||||
range === 'today' ||
|
||||
range === 'lastHour' ||
|
||||
range === '30min' ||
|
||||
range === '7d',
|
||||
},
|
||||
{
|
||||
value: 'month',
|
||||
label: 'Month',
|
||||
|
||||
@@ -13,6 +13,14 @@ export function formatDateInterval(interval: IInterval, date: Date): string {
|
||||
return new Intl.DateTimeFormat('en-GB', { month: 'short' }).format(date);
|
||||
}
|
||||
|
||||
if (interval === 'week') {
|
||||
return new Intl.DateTimeFormat('en-GB', {
|
||||
weekday: 'short',
|
||||
day: '2-digit',
|
||||
month: '2-digit',
|
||||
}).format(date);
|
||||
}
|
||||
|
||||
if (interval === 'day') {
|
||||
return new Intl.DateTimeFormat('en-GB', {
|
||||
weekday: 'short',
|
||||
|
||||
Reference in New Issue
Block a user