mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-30 07:48:11 +01:00
Fixed date filter.
This commit is contained in:
parent
e7ff083a87
commit
7a5b5cc678
@ -13,7 +13,9 @@ export default function WebsiteDateFilter({ websiteId }) {
|
||||
const data = await get(`/websites/${websiteId}`);
|
||||
|
||||
if (data) {
|
||||
setDateRange(`range:${new Date(data.createdAt)}:${Date.now()}`);
|
||||
const start = new Date(data.createdAt).getTime();
|
||||
const end = Date.now();
|
||||
setDateRange(`range:${start}:${end}`);
|
||||
}
|
||||
} else if (value !== 'all') {
|
||||
setDateRange(value);
|
||||
@ -27,6 +29,7 @@ export default function WebsiteDateFilter({ websiteId }) {
|
||||
startDate={startDate}
|
||||
endDate={endDate}
|
||||
onChange={handleChange}
|
||||
showAllTime={true}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -33,7 +33,6 @@ export function BaseParameters() {
|
||||
startDate={startDate}
|
||||
endDate={endDate}
|
||||
onChange={handleDateChange}
|
||||
showAllTime
|
||||
/>
|
||||
</FormRow>
|
||||
</>
|
||||
|
@ -1,7 +1,6 @@
|
||||
import { useState } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { Row, Column } from 'react-basics';
|
||||
import { formatShortTime, formatNumber, formatLongNumber } from 'lib/format';
|
||||
import { formatShortTime } from 'lib/format';
|
||||
import MetricCard from 'components/metrics/MetricCard';
|
||||
import RefreshButton from 'components/input/RefreshButton';
|
||||
import WebsiteDateFilter from 'components/input/WebsiteDateFilter';
|
||||
|
Loading…
Reference in New Issue
Block a user