Skip to content

Commit f588614

Browse files
docs(skills): the formula skill names the hours-between form (#33294)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D4Jsmd91BqTVB7dSii9uJMV)_ Refs #32980 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:公式技能文档(skills/objectstack-formula/SKILL.md)的「想要/写法」表加一行:两个日期时间之间相差几小时,写 `double((datetime(b) - datetime(a)).getMinutes()) / 60.0`。 - 为什么单独一个 PR:skills/** 是受管路径,需要授权审批人合并;#32980 的代码和文案修复在 PR #33291 里正常落地,不必等这一行。 - 风险:只加一行文档,不改任何可编写的元数据。 ## What changes `skills/objectstack-formula/SKILL.md`, Dates table: one row, "Hours between date-times" → `double((datetime(record.end_at) - datetime(record.start_at)).getMinutes()) / 60.0`, between "Tenure in years" and "Sub-day offset". It is the form the date-subtraction refusals name after PR #33291 (#32980). Changeset: `'@objectstack/skills': patch`. Split from PR #33291 at the seat's direction so the code fix is not held by the tier H approval this path needs. ## Tests No code changes. The row is byte-identical to the one PR #33291 carried at `4350de67`, where `check:skill-docs`, `check:skill-examples` and `check:doc-formula-expressions` ran exit 0 and the expression was pinned to validate clean and evaluate to 98 and 3.5 on two served rows (`packages/formula/src/validate-date-text-arithmetic.test.ts`). Pre-push hooks passed on this branch at `68d9bf74`. ## Verification Branch cut from `origin/main` (no merge needed). 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_016WV4cw787kMeaX7oyz7DDC --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent d347942 commit f588614

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): the formula skill's Want/Write table names the hours-between form
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`skills/objectstack-formula/SKILL.md` gains one row, "Hours between" → `double((datetime(record.end_at) - datetime(record.start_at)).getMinutes()) / 60.0`, beside `daysBetween` (whole days), and the date-arithmetic note names that form as the hours exception. It is the same form the date-subtraction refusals now name (#32980's fix); no authorable surface changes.

‎skills/objectstack-formula/SKILL.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,14 @@ tests: every entry resolves at runtime, and this table documents them all.
169169
170170
> **No date arithmetic.** The build refuses `date + n` and `end - start`: a
171171
> date or date-time mixed with a number, or minus another, reads `null`, and
172-
> `today()` / `now()` minus a date field reads `{}`. Use `daysBetween(a, b)`.
172+
> `today()` / `now()` minus a date field reads `{}`. Use `daysBetween(a, b)` for whole days, two `datetime(…)` for hours (row below).
173173
174-
| Want | Write — never `end - start`, `date + n`, `today() + 30` |
174+
| Want | Write — never bare `end - start`, `date + n`, `today() + 30` |
175175
|:---|:---|
176176
| Inclusive span | `daysBetween(record.start_date, record.end_date) + 1` |
177177
| Shift a date | `daysFromNow(n)` / `addDays(d, n)` / `addMonths(d, n)` |
178178
| Tenure in years | `daysBetween(record.hire_date, today()) / 365` |
179+
| Hours between | `double((datetime(record.end_at) - datetime(record.start_at)).getMinutes()) / 60.0` |
179180
| Sub-day offset | `now() + duration("3h")` — the calendar helpers land on UTC midnight |
180181

181182
**Numbers**

0 commit comments

Comments
 (0)