Rearrange date range dropdown logically

pull/106/head
Daksh Shah 2020-09-05 22:10:53 +05:30
parent 83678756c7
commit 4cc75e75d4
No known key found for this signature in database
GPG Key ID: F111A753041D81AD
2 changed files with 3 additions and 13 deletions

View File

@ -3,13 +3,12 @@ import { getDateRange } from 'lib/date';
import DropDown from './DropDown';
const filterOptions = [
{ label: 'Last 24 hours', value: '24hour' },
{ label: 'Last 7 days', value: '7day' },
{ label: 'Last 30 days', value: '30day' },
{ label: 'Last 90 days', value: '90day' },
{ label: 'Today', value: '1day' },
{ label: 'Last 7 days', value: '7day' },
{ label: 'This week', value: '1week' },
{ label: 'Last 30 days', value: '30day' },
{ label: 'This month', value: '1month' },
{ label: 'Last 90 days', value: '90day' },
{ label: 'This year', value: '1year' },
];

View File

@ -4,14 +4,12 @@ import {
addHours,
addDays,
addMonths,
subHours,
subDays,
startOfHour,
startOfDay,
startOfWeek,
startOfMonth,
startOfYear,
endOfHour,
endOfDay,
endOfWeek,
endOfMonth,
@ -75,13 +73,6 @@ export function getDateRange(value) {
unit,
value,
};
case 'hour':
return {
startDate: subHours(startOfHour(now), num - 1),
endDate: endOfHour(now),
unit,
value,
};
}
}