Skip to content

Commit c9135bd

Browse files
committed
chore(changeset): service-analytics patch for the preset window on a date field
Claude-Session: https://claude.ai/code/session_01Utp6Caqg6E9ggEvoUcYsbq Co-authored-by: Claude <noreply@anthropic.com>
1 parent 75b713d commit c9135bd

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/service-analytics': patch
3+
---
4+
5+
fix(service-analytics): a preset `dateRange` on a `date` field counts the reference time zone's calendar days, east of UTC too
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
A dataset or analytics query with a preset `dateRange` (`this_quarter`, `last_30_days`, …) on a dimension whose field is `type: 'date'` counted the wrong calendar days under a reference time zone east of UTC. The preset resolves to the zone's midnight instants, and a `date` column read each instant by its leading UTC day, so the window slid one day early: in `Asia/Shanghai`, `this_quarter` (Q3 2026) counted 2026-06-30 and dropped 2026-09-30. West of UTC the days were already right.
11+
12+
Now a `date` field compares the calendar days the period covers in the reference zone (Q3 is 2026-07-01 through 2026-09-30 in any zone), and a `datetime` field keeps comparing instants. The fix applies on both query strategies, in the drill ranges a windowed answer reports (so a drill still lists exactly what the row counted), and in the draft preview. An explicit `[a, b]` window is unchanged, and so is a field whose type the host cannot name.

0 commit comments

Comments
 (0)