mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
Website edit functionality.
This commit is contained in:
parent
30b87bc4c4
commit
00e232fee8
63 changed files with 301 additions and 94 deletions
24
components/common/DateFilter.js
Normal file
24
components/common/DateFilter.js
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import React from 'react';
|
||||
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: 'This week', value: '1week' },
|
||||
{ label: 'This month', value: '1month' },
|
||||
{ label: 'This year', value: '1year' },
|
||||
];
|
||||
|
||||
export default function DateFilter({ value, onChange, className }) {
|
||||
function handleChange(value) {
|
||||
onChange(getDateRange(value));
|
||||
}
|
||||
|
||||
return (
|
||||
<DropDown className={className} value={value} options={filterOptions} onChange={handleChange} />
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue