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
return i18n.tr(i18n.TR.STATISTICS_INTERVALS_DAY_RANGE, {
daysStart,
daysEnd,
daysEnd: daysEnd - 1,
cards,
});
}

View File

@ -146,11 +146,14 @@ export function dayLabel(i18n: I18n, daysStart: number, daysEnd: number): string
} else {
// range
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 {
return i18n.tr(i18n.TR.STATISTICS_DAYS_AGO_RANGE, {
daysStart: Math.abs(daysEnd),
daysEnd: -daysStart,
daysEnd: -daysStart - 1,
});
}
}