fix overlapping ranges in histograms

It's bin.x0 <= x < bin.x1
This commit is contained in:
Damien Elmes 2020-07-08 14:01:09 +10:00
parent 7a08970bf7
commit 05302e6c2f
2 changed files with 6 additions and 3 deletions

View file

@ -49,7 +49,7 @@ export function intervalLabel(
// range // range
return i18n.tr(i18n.TR.STATISTICS_INTERVALS_DAY_RANGE, { return i18n.tr(i18n.TR.STATISTICS_INTERVALS_DAY_RANGE, {
daysStart, daysStart,
daysEnd, daysEnd: daysEnd - 1,
cards, cards,
}); });
} }

View file

@ -146,11 +146,14 @@ export function dayLabel(i18n: I18n, daysStart: number, daysEnd: number): string
} else { } else {
// range // range
if (daysStart >= 0) { if (daysStart >= 0) {
return i18n.tr(i18n.TR.STATISTICS_IN_DAYS_RANGE, { daysStart, daysEnd }); return i18n.tr(i18n.TR.STATISTICS_IN_DAYS_RANGE, {
daysStart,
daysEnd: daysEnd - 1,
});
} else { } else {
return i18n.tr(i18n.TR.STATISTICS_DAYS_AGO_RANGE, { return i18n.tr(i18n.TR.STATISTICS_DAYS_AGO_RANGE, {
daysStart: Math.abs(daysEnd), daysStart: Math.abs(daysEnd),
daysEnd: -daysStart, daysEnd: -daysStart - 1,
}); });
} }
} }