diff --git a/changelog.d/1531-firms-age-rounding.md b/changelog.d/1531-firms-age-rounding.md index e8cc12c4b..cd9bcfc5d 100644 --- a/changelog.d/1531-firms-age-rounding.md +++ b/changelog.d/1531-firms-age-rounding.md @@ -1,3 +1,5 @@ -- FIRMS fire ages round to whole hours before choosing a unit, so a detection - 47.5–48 hours old reads "2d", as one exactly 48 hours old does, not "48h" - (@quanticsoul4772, #1531). +- FIRMS fire ages round to whole hours before choosing a unit, so an age of + 47.5–48 hours reads "2d", as exactly 48 hours does, not "48h". Detections + are filtered to the trailing 24 hours, so this shows mostly in the + `STALE · cached {age}` stats line after about two days without a successful + refresh (@quanticsoul4772, #1531). diff --git a/docs/CURRENT-STATE.md b/docs/CURRENT-STATE.md index 726201138..1e1230833 100644 --- a/docs/CURRENT-STATE.md +++ b/docs/CURRENT-STATE.md @@ -2382,7 +2382,7 @@ reporting are unchanged. ## FIRMS source status The FIRMS CSV parser rejects impossible acquisition calendar dates before the proxy filters records to the trailing 24 hours, while retaining valid UTC acquisition times. -FIRMS ages round to whole hours before choosing a unit, so a 47.6-hour age reads "2d", not "48h". +FIRMS ages round to whole hours before choosing a unit, so a 47.6-hour age reads "2d", not "48h"; with detections filtered to 24 hours, this shows mostly in the `STALE · cached {age}` stats line. The `get_active_fires` tool reports acquisition times as UTC ISO timestamps, including zero-padded hours and minutes; missing or invalid dates and times remain `null`, including impossible calendar dates from a custom source. diff --git a/src/layers/firms/model.test.mjs b/src/layers/firms/model.test.mjs index 7ff12cf3f..a0df2eb2c 100644 --- a/src/layers/firms/model.test.mjs +++ b/src/layers/firms/model.test.mjs @@ -13,9 +13,11 @@ test('a fire age that rounds to 48 hours reads in days, as 48 hours does', () => try { setLocale('en'); assert.equal(formatAge(47.4 * HOUR_MS), '47h'); + assert.equal(formatAge(47.5 * HOUR_MS), '2d'); assert.equal(formatAge(47.6 * HOUR_MS), '2d'); assert.equal(formatAge(48 * HOUR_MS), '2d'); assert.equal(formatAgeLabel(47.4 * HOUR_MS), '47h'); + assert.equal(formatAgeLabel(47.5 * HOUR_MS), '2d'); assert.equal(formatAgeLabel(47.6 * HOUR_MS), formatAgeLabel(48 * HOUR_MS)); assert.equal(formatAgeLabel(48 * HOUR_MS), '2d'); } finally {