From c5b0c850f90c6e1db0c93deb962aebd48b2dbe33 Mon Sep 17 00:00:00 2001 From: Selina Date: Tue, 2 Dec 2025 18:27:52 +0800 Subject: [PATCH] Simplify date bin size check --- ts/routes/graphs/reviews.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ts/routes/graphs/reviews.ts b/ts/routes/graphs/reviews.ts index 4c83920a4..87d449257 100644 --- a/ts/routes/graphs/reviews.ts +++ b/ts/routes/graphs/reviews.ts @@ -220,9 +220,7 @@ export function renderReviews( function tooltipText(d: BinType, cumulative: number): string { let dateStr: string; const now = new Date(); - const larger = Math.max(Math.abs(d.x0!), Math.abs(d.x1!)); - const smaller = Math.min(Math.abs(d.x0!), Math.abs(d.x1!)); - if (larger - smaller > 1) { + if (d.x1! - d.x0! > 1) { // range (year) let startDate = timeDay.offset(now, Math.floor(d.x0!)); startDate = timeHour.offset(startDate, -sourceData.rolloverHour);