Fixed date range calculations.

This commit is contained in:
Mike Cao 2020-07-30 22:40:16 -07:00
parent 9f112c8cc9
commit 38abd673f3
8 changed files with 55 additions and 21 deletions

View file

@ -14,7 +14,7 @@ export default function PageviewsChart({ data, unit, children }) {
const n = data.pageviews.length;
switch (unit) {
case 'day':
if (n > 7) {
if (n >= 15) {
return index % ~~(n / 15) === 0 ? format(d, 'MMM d') : '';
}
return format(d, 'EEE M/d');