Skip to content
Draft

V0 #42

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
250 commits
Select commit Hold shift + click to select a range
f47a864
chore: project setup
bart-krakowski Jan 19, 2026
cafda97
fix: resolve CI test failures
bart-krakowski Jan 19, 2026
82adbc1
chore: project setup
bart-krakowski Jan 19, 2026
f0f9bac
ci: apply automated fixes
autofix-ci[bot] Jan 19, 2026
b9bdb1b
feat: base
bart-krakowski Jan 19, 2026
450aae7
ci: apply automated fixes
autofix-ci[bot] Jan 19, 2026
6a75f09
feat: parse
bart-krakowski Jan 19, 2026
757a936
feat: withDateOperation HOF and startOf util
bart-krakowski Jan 19, 2026
fe2566d
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Jan 19, 2026
7ba3389
ci: apply automated fixes
autofix-ci[bot] Jan 19, 2026
017176d
feat: endOf util
bart-krakowski Jan 19, 2026
64deac8
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Jan 19, 2026
7dfbee8
ci: apply automated fixes
autofix-ci[bot] Jan 19, 2026
cf47080
feat: returnFormat option
bart-krakowski Jan 20, 2026
bb3ba6d
feat: utils
bart-krakowski Jan 20, 2026
de59d60
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Jan 20, 2026
37e74a4
ci: apply automated fixes
autofix-ci[bot] Jan 20, 2026
c3a958a
feat: utils
bart-krakowski Jan 20, 2026
a010e7e
feat: utils
bart-krakowski Jan 20, 2026
35e7ec8
ci: apply automated fixes
autofix-ci[bot] Jan 20, 2026
68abe50
feat: date comparition utils
bart-krakowski Jan 20, 2026
e56eab8
ci: apply automated fixes
autofix-ci[bot] Jan 20, 2026
b13de3b
feat: date comparition utils
bart-krakowski Jan 20, 2026
843002b
ci: apply automated fixes
autofix-ci[bot] Jan 20, 2026
c468624
refactor: date comparition utils
bart-krakowski Jan 20, 2026
808726b
refactor: date comparition utils
bart-krakowski Jan 20, 2026
4ae20c4
ci: apply automated fixes
autofix-ci[bot] Jan 20, 2026
12998a3
feat: format util
bart-krakowski Jan 21, 2026
f3a70ee
feat: format util
bart-krakowski Jan 21, 2026
deb652e
ci: apply automated fixes
autofix-ci[bot] Jan 21, 2026
b19c47d
feat: isLeapYear, isWeekend and isWeekday utils
bart-krakowski Jan 21, 2026
548c920
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Jan 21, 2026
1e63887
feat: isLeapYear, isWeekend and isWeekday utils
bart-krakowski Jan 21, 2026
584c93f
ci: apply automated fixes
autofix-ci[bot] Jan 21, 2026
ad80650
feat: range util
bart-krakowski Jan 21, 2026
1c12f57
ci: apply automated fixes
autofix-ci[bot] Jan 21, 2026
4d5f75e
refactor: date utils
bart-krakowski Jan 21, 2026
5d6de77
ci: apply automated fixes
autofix-ci[bot] Jan 21, 2026
3ab5235
feat: calendar
bart-krakowski Jan 25, 2026
6aacdf4
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Jan 25, 2026
00186b8
ci: apply automated fixes
autofix-ci[bot] Jan 25, 2026
86ce9ff
feat: calendar
bart-krakowski Jan 26, 2026
2cc34cb
feat: calendar
bart-krakowski Jan 26, 2026
f750163
feat: calendar
bart-krakowski Jan 26, 2026
b3ea5fb
feat: calendar
bart-krakowski Jan 27, 2026
3f223b3
ci: apply automated fixes
autofix-ci[bot] Jan 27, 2026
9dffe0e
feat: event resize
bart-krakowski Jan 29, 2026
d847523
feat: event resize
bart-krakowski Jan 29, 2026
d8e6c6d
feat: event resize
bart-krakowski Jan 29, 2026
144d940
feat: event resize
bart-krakowski Jan 29, 2026
f7791cc
feat: event resize
bart-krakowski Jan 29, 2026
191d818
feat: event resize
bart-krakowski Jan 29, 2026
475b182
feat: event resize
bart-krakowski Jan 29, 2026
d4e34dd
feat: calendar
bart-krakowski Jan 31, 2026
e9ddc6d
feat: calendar example
bart-krakowski Jan 31, 2026
72e9f89
feat: calendar example
bart-krakowski Feb 2, 2026
f5e7298
feat: calendar example
bart-krakowski Feb 2, 2026
5169c0f
feat: availability rules
bart-krakowski Feb 2, 2026
049aa15
feat: availability rules
bart-krakowski Feb 3, 2026
6143276
feat: resources
bart-krakowski Feb 4, 2026
63b149b
feat: devtools setup
bart-krakowski Feb 9, 2026
5375009
feat: devtools
bart-krakowski Feb 10, 2026
dbd7770
feat: calendar
bart-krakowski Feb 13, 2026
c12fc20
ci: apply automated fixes
autofix-ci[bot] Feb 13, 2026
6ce6876
feat: timeline example
bart-krakowski Mar 2, 2026
c664f4d
feat: timeline
bart-krakowski Mar 22, 2026
08d6928
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Mar 22, 2026
e836d42
ci: apply automated fixes
autofix-ci[bot] Mar 22, 2026
5be7365
feat: timeline
bart-krakowski Mar 25, 2026
b8baee3
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Mar 25, 2026
a360030
feat: timeline
bart-krakowski Mar 25, 2026
c755930
feat: timeline
bart-krakowski Mar 26, 2026
2b98c15
feat: lazy loading
bart-krakowski Mar 30, 2026
96d45ac
feat: timeline
bart-krakowski Apr 10, 2026
1d6b541
ci: apply automated fixes
autofix-ci[bot] Apr 10, 2026
e24183a
feat: recursive events
bart-krakowski Apr 20, 2026
b1e8b70
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Apr 20, 2026
1ef4248
ci: apply automated fixes
autofix-ci[bot] Apr 20, 2026
5126298
feat: infinite loading
bart-krakowski Apr 26, 2026
7de3198
feat: capacity/consumption
bart-krakowski May 1, 2026
f380357
feat: capacity/consumption
bart-krakowski May 1, 2026
799d010
ci: apply automated fixes
autofix-ci[bot] May 1, 2026
d85780b
feat: capacity/consumption
bart-krakowski May 1, 2026
fb549b9
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski May 1, 2026
adb40c7
feat: capacity/consumption
bart-krakowski May 1, 2026
c82c5ff
feat: dependencies
bart-krakowski May 5, 2026
40ea174
test: calendar core
bart-krakowski May 8, 2026
9dd8dce
fix: calendar
bart-krakowski May 11, 2026
a649449
test: calendar core
bart-krakowski May 11, 2026
c1c6842
ci: apply automated fixes
autofix-ci[bot] May 11, 2026
9662329
docs: roadmap
bart-krakowski May 11, 2026
db0dc60
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski May 12, 2026
c5806c0
style: format
bart-krakowski May 12, 2026
775e41d
ci: apply automated fixes
autofix-ci[bot] May 12, 2026
385e559
feat: undo and redo
bart-krakowski May 12, 2026
67e3fcc
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski May 12, 2026
15637f6
ci: apply automated fixes
autofix-ci[bot] May 12, 2026
c1faa91
feat: go to next/previous occurrence
bart-krakowski May 13, 2026
d9af6d5
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski May 13, 2026
b654b27
ci: apply automated fixes
autofix-ci[bot] May 13, 2026
bf1517f
ci: add zizmor workflow (#19)
Sheraff May 13, 2026
e29832f
feat: undo and redo
bart-krakowski May 14, 2026
aeb2f98
ci: apply automated fixes
autofix-ci[bot] May 14, 2026
75035a3
fix: calendar
bart-krakowski May 14, 2026
af2d7e7
feat: calendar
bart-krakowski May 14, 2026
59c2573
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski May 14, 2026
4632dc2
ci: apply automated fixes
autofix-ci[bot] May 14, 2026
3a19091
feat: all-day events
bart-krakowski May 14, 2026
390f701
chore(pnpm): update pnpm to v11 (#20)
harry-whorlow May 15, 2026
29dcb6d
security: stricter pnpm config blockExoticSubdeps & trustPolicy (#21)
Sheraff May 18, 2026
79faa0e
feat: calendar example
bart-krakowski May 23, 2026
ea1bece
feat: calendar example
bart-krakowski May 23, 2026
eb2403e
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski May 23, 2026
521ee80
ci: apply automated fixes
autofix-ci[bot] May 23, 2026
29c7083
chore: enforce pnpm 11 (#22)
Sheraff May 26, 2026
76fa0fc
chore: migrate changesets changelog generator (#23)
Sheraff May 27, 2026
4c3400f
chore: ai infrastructure
bart-krakowski Jun 8, 2026
53a3ed2
M:erge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Jun 8, 2026
de97485
ci: apply automated fixes
autofix-ci[bot] Jun 8, 2026
c75fa8c
perf: calendar core
bart-krakowski Jun 9, 2026
78f2c0c
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Jun 9, 2026
fe83afe
ci: apply automated fixes
autofix-ci[bot] Jun 9, 2026
2138497
feat: recurrence exceptions
bart-krakowski Jun 15, 2026
38e1985
ci: apply automated fixes
autofix-ci[bot] Jun 15, 2026
461e3f1
feat: calendar
bart-krakowski Jun 19, 2026
0fd4800
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Jun 19, 2026
dceaf68
ci: apply automated fixes
autofix-ci[bot] Jun 19, 2026
9fe6a0e
docs: adrs
bart-krakowski Jun 21, 2026
3c827b5
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Jun 21, 2026
3c58a2d
ci: apply automated fixes
autofix-ci[bot] Jun 21, 2026
a284814
feat: date primitives functions (#39)
bart-krakowski Jun 21, 2026
7fe9698
ci: apply automated fixes
autofix-ci[bot] Jun 21, 2026
29aacb0
chore: migrate to oxc
bart-krakowski Jun 26, 2026
d14f72f
ci: apply automated fixes
autofix-ci[bot] Jun 26, 2026
471da4b
refactor: kernel
bart-krakowski Jul 20, 2026
6740d0a
ci: apply automated fixes
autofix-ci[bot] Jul 20, 2026
ec1f379
refactor: kernel
bart-krakowski Jul 26, 2026
d6ca38c
refactor: kernel
bart-krakowski Jul 26, 2026
a2e09a8
refactor: kernel
bart-krakowski Aug 1, 2026
cc94be3
ci: apply automated fixes
autofix-ci[bot] Aug 1, 2026
3a6a42f
feat(layout): add overlap facts and pluggable strategies
bart-krakowski Aug 2, 2026
27ad242
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Aug 2, 2026
a01fed7
ci: apply automated fixes
autofix-ci[bot] Aug 2, 2026
0655c44
feat: availability module
bart-krakowski Aug 2, 2026
49a1761
ci: apply automated fixes
autofix-ci[bot] Aug 2, 2026
f623749
feat: dependency module
bart-krakowski Aug 3, 2026
6857d85
feat: dependency module
bart-krakowski Aug 3, 2026
93ece35
ci: apply automated fixes
autofix-ci[bot] Aug 3, 2026
cbc3658
feat: drag-resize module
bart-krakowski Aug 3, 2026
8fd6b54
ci: apply automated fixes
autofix-ci[bot] Aug 3, 2026
c72d671
feat: undo module
bart-krakowski Aug 3, 2026
41811c6
feat(calendar): expose ISO dates
bart-krakowski Aug 4, 2026
d1b1021
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Aug 4, 2026
cc84c9b
ci: apply automated fixes
autofix-ci[bot] Aug 4, 2026
f801e24
refactor: kernel
bart-krakowski Aug 4, 2026
d0c5a11
ci: apply automated fixes
autofix-ci[bot] Aug 4, 2026
a17183c
refactor: kernel
bart-krakowski Aug 4, 2026
f2f85f7
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Aug 4, 2026
b68c97a
ci: apply automated fixes
autofix-ci[bot] Aug 4, 2026
47f8f63
docs: feature composition
bart-krakowski Aug 4, 2026
e6ff83d
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Aug 4, 2026
70c9a92
feat(kernel): let modules contribute public api
bart-krakowski Aug 4, 2026
21a3638
ci: apply automated fixes
autofix-ci[bot] Aug 4, 2026
c2c9021
feat(calendar): add host-aware feature api seam
bart-krakowski Aug 5, 2026
a932cb0
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Aug 5, 2026
4e8598e
ci: apply automated fixes
autofix-ci[bot] Aug 5, 2026
9daaa94
feat(calendar): move createDependency to its feature
bart-krakowski Aug 5, 2026
5b85c91
ci: apply automated fixes
autofix-ci[bot] Aug 5, 2026
f212bb5
style: comments
bart-krakowski Aug 5, 2026
96898db
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Aug 5, 2026
a0245fd
ci: apply automated fixes
autofix-ci[bot] Aug 5, 2026
388ae39
feat(calendar): move editRecurringEvent and removeRecurringEvent to e…
bart-krakowski Aug 5, 2026
2fcaf11
ci: apply automated fixes
autofix-ci[bot] Aug 5, 2026
d3a361f
feat(calendar): move resize controller to a feature
bart-krakowski Aug 5, 2026
e6b94e1
refactor: kernel
bart-krakowski Aug 5, 2026
83faa36
ci: apply automated fixes
autofix-ci[bot] Aug 5, 2026
64d4bd1
feat(calendar): compose features via features option
bart-krakowski Aug 6, 2026
ea139d7
feat(calendar): compose features via features option
bart-krakowski Aug 6, 2026
d2a7971
feat(calendar): compose features via features option
bart-krakowski Aug 6, 2026
d5a8ef1
feat: improve error handling
bart-krakowski Aug 6, 2026
0169e78
feat: improve error handling
bart-krakowski Aug 6, 2026
ba368c2
feat(calendar): gate the api type by composed features
bart-krakowski Aug 6, 2026
6e30229
feat(calendar): add stockFeatures for one-line composition
bart-krakowski Aug 7, 2026
442b4c2
ci: apply automated fixes
autofix-ci[bot] Aug 7, 2026
4c16145
refactor(calendar): extract resourceAvailabilityFeature
bart-krakowski Aug 7, 2026
9e765fd
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Aug 7, 2026
c13359b
ci: apply automated fixes
autofix-ci[bot] Aug 7, 2026
f457aad
refactor(calendar): give features peers, move validateResize out
bart-krakowski Aug 7, 2026
d67adac
ci: apply automated fixes
autofix-ci[bot] Aug 7, 2026
19eb58c
feat(calendar): enforce availability in the write pipeline
bart-krakowski Aug 7, 2026
2db1ee0
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Aug 7, 2026
a94e023
ci: apply automated fixes
autofix-ci[bot] Aug 7, 2026
595055b
feat(solid-time): add the Solid calendar adapter
bart-krakowski Aug 7, 2026
eec5856
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Aug 7, 2026
366812f
ci: apply automated fixes
autofix-ci[bot] Aug 7, 2026
04cbd10
feat(time): add working-time calendar resolver
bart-krakowski Aug 7, 2026
a16697b
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Aug 7, 2026
a242514
feat(time)!: replace Resource.availability with calendars
bart-krakowski Aug 7, 2026
22ecb3e
ci: apply automated fixes
autofix-ci[bot] Aug 7, 2026
e2e3098
feat(time): add event calendar overrides and union policy
bart-krakowski Aug 7, 2026
1ec5e1d
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Aug 7, 2026
aa7dec7
ci: apply automated fixes
autofix-ci[bot] Aug 7, 2026
99286b8
feat(time): give the working-time resolver a feature surface
bart-krakowski Aug 7, 2026
1a0e2fd
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Aug 7, 2026
512a14f
ci: apply automated fixes
autofix-ci[bot] Aug 7, 2026
c210e4b
feat(time): give dependencies lag and lead
bart-krakowski Aug 8, 2026
4249219
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Aug 8, 2026
8f35c3d
ci: apply automated fixes
autofix-ci[bot] Aug 8, 2026
759095a
fix: resolve type, lint, knip and sherif failures
bart-krakowski Aug 8, 2026
9c5e554
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Aug 8, 2026
01e4d17
feat(time): make manuallyScheduled events anchors
bart-krakowski Aug 8, 2026
46ad3e5
feat(time): make manuallyScheduled events anchors
bart-krakowski Aug 8, 2026
e980dfb
ci: apply automated fixes
autofix-ci[bot] Aug 8, 2026
e11bfcb
feat(time): honour scheduling constraints on the event model
bart-krakowski Aug 9, 2026
2becb09
ci: apply automated fixes
autofix-ci[bot] Aug 9, 2026
f80a114
feat(time): derive duration from working time, carry effort
bart-krakowski Aug 10, 2026
924bb43
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Aug 10, 2026
2bcfa65
ci: apply automated fixes
autofix-ci[bot] Aug 10, 2026
e4705cb
refactor(time): date primitives return native Date
bart-krakowski Aug 10, 2026
6802d02
refactor(time)!: drop rounding units a Date cannot express
bart-krakowski Aug 10, 2026
8b5198f
feat: examples
bart-krakowski Aug 10, 2026
ec0ca6b
ci: apply automated fixes
autofix-ci[bot] Aug 10, 2026
f76d860
chore: vercel congigs
bart-krakowski Aug 11, 2026
59259c6
feat: solver
bart-krakowski Aug 14, 2026
80ebf12
ci: apply automated fixes
autofix-ci[bot] Aug 14, 2026
0e333cf
feat: filtering and dnd
bart-krakowski Aug 19, 2026
ce9ced0
ci: apply automated fixes
autofix-ci[bot] Aug 19, 2026
7435637
chore: update devtools
bart-krakowski Aug 19, 2026
30cb645
fix(time): notify store subscribers on setResources/setEvents
bart-krakowski Aug 20, 2026
f164af0
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Aug 20, 2026
4ae30de
ci: apply automated fixes
autofix-ci[bot] Aug 20, 2026
ed7a5e8
feat(time): add eventMoveFeature for drag-to-move
bart-krakowski Aug 21, 2026
38cb416
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Aug 21, 2026
cd03431
ci: apply automated fixes
autofix-ci[bot] Aug 21, 2026
f3e61b2
feat(time): add eventMoveFeature for drag-to-move
bart-krakowski Aug 21, 2026
b9fec9d
Merge branch 'alpha' of github.com:TanStack/time into alpha
bart-krakowski Aug 21, 2026
fec70d2
feat(devtools): unify styling
bart-krakowski Aug 21, 2026
0aa9ac3
ci: apply automated fixes
autofix-ci[bot] Aug 21, 2026
d4c4ea7
fix: virtualization example
bart-krakowski Aug 21, 2026
6979b75
fix: virtualization example
bart-krakowski Aug 21, 2026
3ad9abc
chore: update devtools
bart-krakowski Aug 22, 2026
6d71922
chore: update deps
bart-krakowski Aug 22, 2026
474c06f
chore: update deps
bart-krakowski Aug 22, 2026
8dd4199
ci: apply automated fixes
autofix-ci[bot] Aug 22, 2026
a78a6f2
chore: update deps
bart-krakowski Aug 22, 2026
bd773cc
Merge branch 'v0' of github.com:TanStack/time into v0
bart-krakowski Aug 22, 2026
0ea8595
ci: apply automated fixes
autofix-ci[bot] Aug 22, 2026
5bd7ff2
chore: update deps
bart-krakowski Aug 22, 2026
2d1ca60
Merge branch 'v0' of github.com:TanStack/time into v0
bart-krakowski Aug 22, 2026
9b3b67e
ci: apply automated fixes
autofix-ci[bot] Aug 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
64 changes: 64 additions & 0 deletions .ai/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# AI Agent Instructions

## Project Context

TanStack Time is a headless time/calendar utility library for TS/JS, React, Solid, Vue, Svelte, Angular. Uses Temporal API polyfill. Monorepo under pnpm + nx.

## Core Constraints

- All public API methods return Date or string. Never Temporal objects.
- Input dates: RFC 3339 string, epoch numeric, or Date object.
- Formatting via Intl.DateTimeFormat parts, not string tokens.
- Timezone and calendar are always tracked. Defaults from Intl.DateTimeFormat.
- Date objects are mutable. Never mutate inputs.

## Package Hierarchy

- `@tanstack/time` — core logic (calendar, date ops, formatting)
- `@tanstack/react-time` — React hooks (useCalendar), re-exports from core
- `@tanstack/time-devtools` — devtools UI, depends on core
- `@tanstack/solid-time` — Solid adapter (mirrors react-time)
- `@tanstack/solid-time-devtools` — Solid devtools

## File Organization

- `packages/time/src/date/` — date manipulation (add, subtract, startOf, endOf, format, parse, etc.)
- `packages/time/src/calendar/` — calendar engine (CalendarCore, DateCore, event rendering, recurrence, resizing)
- `packages/time/src/client/` — client-side utilities
- `packages/time/src/formatter/` — Intl.DateTimeFormat wrappers
- `packages/time/src/utils/` — shared helpers

## Testing

- Vitest for unit tests. `*.test.ts` co-located with source.
- React tests use `@testing-library/react`.
- No comment policy: zero comments in source. Prefer naming, types, structure.

## Build

- `tsdown` for bundling. Outputs ESM + CJS.
- `nx` for task orchestration.
- `pnpm` for package management.

## Key Files

- `packages/time/src/calendar/calendar.ts` — CalendarCore class
- `packages/time/src/calendar/date-core.ts` — DateCore abstract class
- `packages/time/src/date/index.ts` — date utility exports
- `packages/time/src/index.ts` — top-level exports
- `Methodology.md` — API design philosophy
- `TODO.md` — roadmap

## Navigation

- Read `.ai/graph.json` before exploring. It contains the full package map, file lists, exports, dependencies, and test locations.
- Use the `edges` array to trace internal dependencies and identify affected packages before modifying core logic.
- If `graph.json` is stale or missing, run `pnpm run graphify` to regenerate it.

## Agent Rules

- Do not add comments to source code.
- Follow existing code style. Use explicit types.
- When changing core, check react-time and devtools for breakage.
- Run `pnpm test:lib` and `pnpm test:types` before declaring done.
- All new date logic must handle timezone and calendar correctly.
20 changes: 20 additions & 0 deletions .ai/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# AI Infrastructure

Generated and maintained for AI agents working on TanStack Time.

## Graphify

`pnpm run graphify` generates `.ai/graph.json` — a machine-readable graph of the monorepo (packages, exports, dependencies, files, tests).

## Spec Kit

`.ai/spec-kit/` contains domain-specific specifications:

- `architecture.md` — monorepo structure, package relationships, build system
- `testing.md` — test framework, commands, coverage expectations
- `api-design.md` — input/output contracts, method signatures, design philosophy
- `calendar-domain.md` — Temporal API, event model, recurrence, availability, views

## Agent Context

`.ai/AGENTS.md` — top-level instructions for AI agents. Read this first.
399 changes: 399 additions & 0 deletions .ai/graph.json

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions .ai/spec-kit/api-design.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# API Design Spec

## Design Philosophy

TanStack Time is designed after TanStack Query and TanStack Table: headless, framework-agnostic core with thin framework adapters. See `Methodology.md` for detailed rationale.

## Input Contracts

- Dates accepted as RFC 3339 string, epoch milliseconds (number), or Date object.
- Timezone and calendar are explicit parameters. If omitted, defaults from `Intl.DateTimeFormat`.
- Never mutate input Date objects. Always clone or create new Temporal instances.

## Output Contracts

- Public methods return either Date objects or strings.
- Never return Temporal objects directly to consumers.
- Methods return `{ value, options }` tuple where `options` carries timezone/calendar used.
- Formatting methods return string parts via Intl.DateTimeFormat.

## Method Signature Pattern

```ts
function operationName({
date,
unit,
returnFormat,
options,
}: {
date: Date | string | number
unit: DateUnit
returnFormat?: 'standard' | 'long' | 'epoch' | 'Date' | 'ZonedDateTime'
options?: { timeZone?: string; calendar?: string }
}): { value: ReturnType; options: { timeZone: string; calendar: string } }
```

## Chaining vs Standalone

- Prefer standalone functions over fluent/chaining APIs.
- Chaining creates object overhead and hinders treeshaking.
- Each function is idempotent and composable.

## TypeScript Requirements

- All public APIs must be fully typed.
- Generic parameters for calendar resources and events.
- No `any` in public surface.

## Framework Adapter Pattern

- Core is pure TS/JS. No framework dependencies.
- React adapter: `useCalendar` hook that creates `CalendarCore` instance and exposes reactive selectors.
- Solid adapter: equivalent `useCalendar` using Solid's reactive primitives.
- Devtools are separate packages that inject into core store.
62 changes: 62 additions & 0 deletions .ai/spec-kit/architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Architecture Spec

## Monorepo Layout

```
packages/
time/ — core package
src/date/ — date manipulation primitives
src/calendar/ — calendar engine
src/client/ — client utilities
src/formatter/ — Intl.DateTimeFormat wrappers
src/utils/ — shared helpers
src/index.ts — public API surface
react-time/ — React adapter
src/useCalendar/ — useCalendar hook
src/index.ts — re-exports core + React-specific
time-devtools/ — devtools UI
src/components/ — UI components (Solid-based via goober)
src/store/ — devtools state
src/core.tsx — devtools core
solid-time/ — Solid adapter (mirrors react-time)
solid-time-devtools/ — Solid devtools
```

## Dependency Graph

- `react-time` → `time`
- `time-devtools` → `time`
- `solid-time` → `time`
- `solid-time-devtools` → `time`

## Build System

- `tsdown` bundles each package. Produces `dist/index.js` (ESM) and `dist/index.cjs` (CJS).
- `nx` caches builds and runs tests selectively.
- Root scripts run via `nx run-many` or `nx affected`.

## Public API Surface

Core exports from `@tanstack/time`:

- Date primitives: `add`, `subtract`, `startOf`, `endOf`, `format`, `parse`, `equals`, `isBefore`, `isAfter`, `isBetween`, `range`, `since`, `until`
- Calendar: `CalendarCore`, `DateCore`, event helpers, recurrence logic
- Types: `CalendarEvent`, `CalendarResource`, `ResizeState`, etc.

React exports from `@tanstack/react-time`:

- `useCalendar` hook
- `ResizeState`, `ResizeOptions`, `UseCalendarOptions`
- Re-exports of core event utilities and types

## State Management

- Core uses `@tanstack/store` for reactive state.
- React adapter uses `@tanstack/react-store`.
- CalendarCore maintains event collections, selected dates, current view.

## Key Abstractions

- `DateCore` — abstract base for date operations and navigation
- `CalendarCore<TResource, TEvent>` — concrete calendar with events, resources, availability
- `useCalendar` — React hook that instantiates CalendarCore and provides reactive selectors
51 changes: 51 additions & 0 deletions .ai/spec-kit/calendar-domain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Calendar Domain Spec

## Temporal API

- Until native browser support, use `@js-temporal/polyfill`.
- Internal computations use `Temporal.ZonedDateTime` and `Temporal.PlainDate`.
- Public API never exposes Temporal objects.

## Timezone and Calendar

- A date/time instance is not a static point; it is relative to timezone and calendar.
- Always track timezone and calendar alongside the instant value.
- RFC 3339 extended format may include timezone and calendar: `2024-03-05T12:34:56.789Z[America/New_York][u-ca=gregory]`.

## Event Model

- `CalendarEvent` has: id, start, end, title, allDay flag, recurrence rule, resources, dependencies, metadata.
- `CalendarResource` has: id, title, availability windows, unavailability rules.
- Events can span multiple days. Split multi-day events into per-day segments for rendering.
- All-day events have no time component. Rendered at top of day view.

## Recurrence

- Supported: daily, weekly, monthly, yearly.
- Recurrence exceptions: EXDATE (skip occurrences), modified single occurrences.
- End conditions: UNTIL date, COUNT number.
- Expand recurring events into individual occurrences before rendering.

## Resizing and Dragging

- `ResizeController` handles pointer events for event resizing.
- `calculateSegmentResizePreview` computes preview state during resize.
- `calculateGhostPreviewStyle` computes CSS for drag ghost.
- `calculateTimelineResizePreview` computes timeline-specific resize preview.
- `getResizeProps` returns styling props for resize handles.

## Availability

- Resources define availability windows (start/end times per day).
- Unavailability rules define blocked ranges.
- `validateEventDependencies` checks if placing an event satisfies dependency constraints.
- `getUnavailableRanges` returns blocked ranges for a date.

## Views

- CalendarCore supports: day, week, month, year, agenda, timeline.
- `groupDaysBy` groups days by unit (week, month) for grid layouts.
- `goToSpecificPeriod` navigates to a specific date with view context.
- `getEventsByDate` retrieves all events for a date (including multi-day segments).
- `getAllDayEventsByDate` retrieves all-day events for a date.
- `getTimeSlots` generates time slots for day/week views.
36 changes: 36 additions & 0 deletions .ai/spec-kit/testing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Testing Spec

## Test Framework

- Vitest for all unit and integration tests.
- Co-located tests: `*.test.ts` in same directory as source.
- React tests use `@testing-library/react` + `@testing-library/jest-dom` matchers.
- Faker via `@faker-js/faker` for test data generation.

## Test Commands

- `pnpm test:lib` — run Vitest tests
- `pnpm test:lib:dev` — watch mode
- `pnpm test:types` — TypeScript type checking via `tsc --noEmit`
- `pnpm test:lint` — linting
- `pnpm test:ci` — full CI suite (oxlint, sherif, knip, docs, lib, types, build)

## Coverage Expectations

- Date primitives: edge cases around leap years, timezone transitions, calendar variants
- Calendar engine: event overlap, multi-day splitting, recurrence, resize, availability
- React hooks: render cycles, state updates, unmount cleanup

## Test Patterns

- Use explicit timezones in calendar tests. Avoid relying on local system time.
- Create helper functions for common calendar setup to reduce boilerplate.
- Mock Temporal API polyfill behavior when testing edge cases.
- For resize/drag tests, simulate pointer events and verify state transitions.

## CI Requirements

- `pnpm test:pr` must pass before merge.
- `pnpm test:sherif` ensures dependency consistency across packages.
- `pnpm test:knip` detects unused exports and dependencies.
- `pnpm test:docs` verifies all markdown links are valid.
14 changes: 14 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
"changelog": ["@changesets/changelog-github", { "repo": "TanStack/time", "disableThanks": true }],
"commit": false,
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"fixed": [],
"linked": [],
"ignore": [],
"___experimentalUnsafeOptions_WILL_CHANGE_IN_PATCH": {
"onlyUpdatePeerDependentsWhenOutOfRange": true
}
}
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# These are supported funding model platforms

github: tannerlinsley
Loading
Loading