mirror of
https://github.com/kremalicious/umami.git
synced 2024-12-18 15:23:38 +01:00
9 lines
268 B
JavaScript
9 lines
268 B
JavaScript
|
import { useSelector } from 'react-redux';
|
||
|
import { getDateRange } from 'lib/date';
|
||
|
|
||
|
export function useDateRange(websiteId, defaultDateRange = '7day') {
|
||
|
return useSelector(
|
||
|
state => state.websites[websiteId]?.dateRange || getDateRange(defaultDateRange),
|
||
|
);
|
||
|
}
|