Skip to content

Commit 8927fbc

Browse files
committed
docs(spec): the filter-preset-ordering-comparand-refused entry's replacement names the closed last_30_days window; the changeset carries lint and verify
Claude-Session: https://claude.ai/code/session_012uFegdfR6K6uqvLzt7XsdZ Co-authored-by: Claude <noreply@anthropic.com>
1 parent da95e4e commit 8927fbc

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎.changeset/23170-rolling-presets-close-on-today.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
---
22
'@objectstack/spec': patch
33
'@objectstack/core': patch
4+
'@objectstack/lint': patch
5+
'@objectstack/verify': patch
46
---
57

68
fix(spec,core): the rolling `last_7_days`, `last_30_days` and `last_90_days` presets close on today, at the spec's prescription table, the save door's refusal and the analytics preset arm
@@ -12,5 +14,6 @@ The three rolling windows were the open arm of `DATE_RANGE_PRESET_MACRO_WINDOWS`
1214
- `DATE_RANGE_PRESET_MACRO_WINDOWS` now closes every rolling window on `{today}`: `last_7_days` is `['{7_days_ago}', '{today}']`, and `last_30_days` and `last_90_days` follow the same shape. That is the inclusive last-day end every calendar preset already uses, and the extent the console's lowering already selects. The table's declared type narrows to match, `readonly [start: string, end: string]` (it was `end: string | null`). A reader that compared `end` with `null` still compiles; that branch can no longer be taken.
1315
- The save door's refusal of a bare preset comparand (`bareDateRangePresetComparandMessage`, and the `filter-preset-comparand` lint verdict that quotes it) now prescribes the closed window. For `last_30_days` it says: write `{ $between: ['{30_days_ago}', '{today}'] }`, where it used to say `{ $gte: '{30_days_ago}' }`.
1416
- `@objectstack/core`'s `resolveAnalyticsDateRangePreset`, the preset arm behind `timeDimensions[].dateRange`, selects the same extent. A rolling window now stops before tomorrow begins in the reference timezone, exactly as `today` does, with `endExclusive: true`. It used to end at the reference instant, so it dropped rows stamped later today. Its ends keep this module's own "the day the window stops before" spelling (`tomorrow`). Every preset this resolver returns is now `endExclusive: true`, and a caller's explicit `[a, b]` window keeps its inclusive reading, as before.
17+
- The semantic migration entry `filter-preset-ordering-comparand-refused`, which `spec-changes.json` and `os migrate meta` carry, now names `{ $between: ["{30_days_ago}", "{today}"] }` as the window for `last_30_days` in its replacement, where it named `{ $gte: "{30_days_ago}" }`.
1518

1619
If you followed the old refusal and authored `{ $gte: '{N_days_ago}' }` for a rolling preset, add `$lte: '{today}'`, or write the `$between` pair above, to stop counting future-dated rows.

‎packages/spec/src/migrations/entries/semantic/18.filter-preset-ordering-comparand-refused.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const entry: SemanticMigration = {
2828
+ 'flow CRUD node\'s config.filter). The lint is likewise what refuses a preset in an '
2929
+ 'ordering filter triple wherever its walk meets one',
3030
replacement:
31-
'the date-macro window the preset already means — { $gte: "{30_days_ago}" } for '
31+
'the date-macro window the preset already means — { $between: ["{30_days_ago}", "{today}"] } for '
3232
+ 'last_30_days, { $between: ["{week_start}", "{week_end}"] } for this_week, and so on '
3333
+ '(the rejection names the exact window per preset; DATE_RANGE_PRESET_MACRO_WINDOWS in '
3434
+ '@objectstack/spec/data is the table) — or an ISO date such as 2026-01-15. The preset '

0 commit comments

Comments
 (0)