mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 14:17:13 +01:00
Change date filter format.
This commit is contained in:
parent
efdbd1c632
commit
0c8d9eacd3
7 changed files with 44 additions and 32 deletions
|
|
@ -11,10 +11,11 @@ export default function PageviewsChart({ data, unit }) {
|
|||
const renderLabel = useCallback(
|
||||
(label, index, values) => {
|
||||
const d = new Date(values[index].value);
|
||||
const n = data.pageviews.length;
|
||||
switch (unit) {
|
||||
case 'day':
|
||||
if (data.pageviews.length > 7) {
|
||||
return index % 2 !== 0 ? format(d, 'MMM d') : '';
|
||||
if (n > 7) {
|
||||
return index % (n / 15) === 0 ? format(d, 'MMM d') : '';
|
||||
}
|
||||
return format(d, 'EEE M/d');
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue