diff --git a/.ai/AGENTS.md b/.ai/AGENTS.md new file mode 100644 index 00000000..4e0f7496 --- /dev/null +++ b/.ai/AGENTS.md @@ -0,0 +1,65 @@ +# 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. +- Prefer small focused functions over classes. +- All new date logic must handle timezone and calendar correctly. diff --git a/.ai/README.md b/.ai/README.md new file mode 100644 index 00000000..4c9d973f --- /dev/null +++ b/.ai/README.md @@ -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. diff --git a/.ai/graph.json b/.ai/graph.json new file mode 100644 index 00000000..d21cd61c --- /dev/null +++ b/.ai/graph.json @@ -0,0 +1,302 @@ +{ + "generated": "2026-06-08T11:19:58.167Z", + "packages": [ + { + "name": "@tanstack/react-time", + "path": "packages/react-time", + "exports": [ + "useCalendar from ./useCalendar", + "calculateGhostPreviewStyle from @tanstack/time", + "calculateSegmentResizePreview from @tanstack/time", + "calculateTimelineResizePreview from @tanstack/time", + "formatEventTimeRange from @tanstack/time", + "getEventDisplayTimeRange from @tanstack/time", + "getSegmentInfo from @tanstack/time", + "isMultiDayEvent from @tanstack/time", + "useCalendar", + "calculateGhostPreviewStyle", + "calculateSegmentResizePreview", + "calculateTimelineResizePreview", + "formatEventTimeRange", + "getEventDisplayTimeRange", + "getSegmentInfo", + "isMultiDayEvent" + ], + "dependencies": ["@tanstack/react-store", "@tanstack/time"], + "devDependencies": [ + "@eslint-react/eslint-plugin", + "@testing-library/react", + "@types/react", + "@vitejs/plugin-react", + "eslint-plugin-react-compiler", + "eslint-plugin-react-hooks", + "react" + ], + "peerDependencies": ["react", "react-dom"], + "internalDeps": ["@tanstack/react-store", "@tanstack/time"], + "files": [ + "packages/react-time/src/index.ts", + "packages/react-time/src/useCalendar/index.ts", + "packages/react-time/src/useCalendar/useCalendar.ts" + ], + "tests": [] + }, + { + "name": "@tanstack/react-time-devtools", + "path": "packages/react-time-devtools", + "exports": ["TimeDevtoolsPanel", "timeDevtoolsPlugin"], + "dependencies": ["@tanstack/devtools-utils", "@tanstack/time-devtools"], + "devDependencies": [ + "@eslint-react/eslint-plugin", + "@types/react", + "@vitejs/plugin-react", + "eslint-plugin-react-compiler", + "eslint-plugin-react-hooks", + "react", + "solid-js" + ], + "peerDependencies": ["react", "react-dom"], + "internalDeps": ["@tanstack/devtools-utils", "@tanstack/time-devtools"], + "files": [ + "packages/react-time-devtools/src/index.ts", + "packages/react-time-devtools/src/production.ts" + ], + "tests": [] + }, + { + "name": "@tanstack/solid-time", + "path": "packages/solid-time", + "exports": [], + "dependencies": ["@tanstack/solid-store", "@tanstack/time"], + "devDependencies": ["@types/node", "solid-js", "vite-plugin-solid"], + "peerDependencies": ["solid-js"], + "internalDeps": ["@tanstack/solid-store", "@tanstack/time"], + "files": ["packages/solid-time/src/index.ts"], + "tests": [] + }, + { + "name": "@tanstack/solid-time-devtools", + "path": "packages/solid-time-devtools", + "exports": ["TimeDevtools", "timeDevtoolsPlugin"], + "dependencies": ["@tanstack/devtools-utils", "@tanstack/time-devtools"], + "devDependencies": ["solid-js", "vite-plugin-solid"], + "peerDependencies": ["solid-js"], + "internalDeps": ["@tanstack/devtools-utils", "@tanstack/time-devtools"], + "files": [ + "packages/solid-time-devtools/src/index.ts", + "packages/solid-time-devtools/src/production.ts" + ], + "tests": [] + }, + { + "name": "@tanstack/time", + "path": "packages/time", + "exports": ["* from ./date", "* from ./calendar", "* from ./client"], + "dependencies": ["@tanstack/devtools-event-client", "@tanstack/store"], + "devDependencies": ["vite-tsconfig-paths"], + "peerDependencies": [], + "internalDeps": ["@tanstack/devtools-event-client", "@tanstack/store"], + "files": [ + "packages/time/src/index.ts", + "packages/time/src/calendar/calendar.ts", + "packages/time/src/calendar/date-core.ts", + "packages/time/src/calendar/expandRecurringEvent.ts", + "packages/time/src/calendar/generateDateRange.ts", + "packages/time/src/calendar/getEventProps.ts", + "packages/time/src/calendar/getResizeProps.ts", + "packages/time/src/calendar/getTimeSlots.ts", + "packages/time/src/calendar/groupDaysBy.ts", + "packages/time/src/calendar/index.ts", + "packages/time/src/calendar/resizeController.ts", + "packages/time/src/calendar/splitMultiDayEvents.ts", + "packages/time/src/calendar/types.ts", + "packages/time/src/client/TimeClient.ts", + "packages/time/src/client/index.ts", + "packages/time/src/formatter/extractLocaleOptions.ts", + "packages/time/src/formatter/shared.ts", + "packages/time/src/date/index.ts", + "packages/time/src/date/types.ts", + "packages/time/src/date/validateDate.ts", + "packages/time/src/utils/dateDefaults.ts", + "packages/time/src/utils/dateRange.ts", + "packages/time/src/utils/dateTimeDefaults.ts", + "packages/time/src/utils/index.ts", + "packages/time/src/utils/weekUtils.ts", + "packages/time/src/formatter/buildDateFormatter/buildDateFormatter.ts", + "packages/time/src/formatter/buildDateFormatter/index.ts", + "packages/time/src/polyfills/getWeekInfo.ts", + "packages/time/src/polyfills/types.ts", + "packages/time/src/polyfills/weekInfoData.ts", + "packages/time/src/formatter/buildDateTimeFormatter/buildDateTimeFormatter.ts", + "packages/time/src/formatter/buildDateTimeFormatter/index.ts", + "packages/time/src/formatter/buildTimeFormatter/buildTimeFormatter.ts", + "packages/time/src/formatter/buildTimeFormatter/index.ts", + "packages/time/src/formatter/buildFinalFormatter/buildFinalFormatter.ts", + "packages/time/src/formatter/buildFinalFormatter/index.ts", + "packages/time/src/date/add/add.ts", + "packages/time/src/date/add/index.ts", + "packages/time/src/date/endOf/endOf.ts", + "packages/time/src/date/endOf/index.ts", + "packages/time/src/date/equals/equals.ts", + "packages/time/src/date/equals/index.ts", + "packages/time/src/date/format/format.ts", + "packages/time/src/date/format/index.ts", + "packages/time/src/date/helpers/index.ts", + "packages/time/src/date/helpers/normalizeLocale.ts", + "packages/time/src/date/helpers/normalizeWeek.ts", + "packages/time/src/date/helpers/toZonedDateTime.ts", + "packages/time/src/date/intersects/index.ts", + "packages/time/src/date/intersects/intersects.ts", + "packages/time/src/date/isAfter/index.ts", + "packages/time/src/date/isAfter/isAfter.ts", + "packages/time/src/date/isBefore/index.ts", + "packages/time/src/date/isBefore/isBefore.ts", + "packages/time/src/date/isBetween/index.ts", + "packages/time/src/date/isBetween/isBetween.ts", + "packages/time/src/date/isSameOrAfter/index.ts", + "packages/time/src/date/isSameOrAfter/isSameOrAfter.ts", + "packages/time/src/date/isSameOrBefore/index.ts", + "packages/time/src/date/isSameOrBefore/isSameOrBefore.ts", + "packages/time/src/date/isLeapYear/index.ts", + "packages/time/src/date/isLeapYear/isLeapYear.ts", + "packages/time/src/date/isValidDate/index.ts", + "packages/time/src/date/isValidDate/isValidDate.ts", + "packages/time/src/date/isWeekend/index.ts", + "packages/time/src/date/isWeekend/isWeekend.ts", + "packages/time/src/date/range/index.ts", + "packages/time/src/date/range/range.ts", + "packages/time/src/date/parse/index.ts", + "packages/time/src/date/parse/parse.ts", + "packages/time/src/date/round/index.ts", + "packages/time/src/date/round/round.ts", + "packages/time/src/date/since/index.ts", + "packages/time/src/date/since/since.ts", + "packages/time/src/date/startOf/index.ts", + "packages/time/src/date/startOf/startOf.ts", + "packages/time/src/date/subtract/index.ts", + "packages/time/src/date/subtract/subtract.ts", + "packages/time/src/date/until/index.ts", + "packages/time/src/date/until/until.ts", + "packages/time/src/date/withDateOperation/index.ts", + "packages/time/src/date/withDateOperation/withDateOperation.ts" + ], + "tests": [ + "packages/time/src/calendar/tests/calendar.test.ts", + "packages/time/src/date/withDateOperation/withDateOperation.test.ts", + "packages/time/src/date/add/tests/add.test.ts", + "packages/time/src/formatter/buildFinalFormatter/tests/buildFinalFormatter.test.ts", + "packages/time/src/date/endOf/tests/endOf.test.ts", + "packages/time/src/date/equals/tests/equals.test.ts", + "packages/time/src/date/format/tests/format.test.ts", + "packages/time/src/date/intersects/tests/intersects.test.ts", + "packages/time/src/date/isBefore/tests/isBefore.test.ts", + "packages/time/src/date/isBetween/tests/isBetween.test.ts", + "packages/time/src/date/isSameOrAfter/tests/isSameOrAfter.test.ts", + "packages/time/src/date/isAfter/tests/isAfter.test.ts", + "packages/time/src/date/isSameOrBefore/tests/isSameOrBefore.test.ts", + "packages/time/src/date/isLeapYear/tests/isLeapYear.test.ts", + "packages/time/src/date/isValidDate/tests/isValidDate.test.ts", + "packages/time/src/date/isWeekend/tests/isWeekend.test.ts", + "packages/time/src/date/parse/tests/parse.test.ts", + "packages/time/src/date/range/tests/range.test.ts", + "packages/time/src/date/round/tests/round.test.ts", + "packages/time/src/date/since/tests/since.test.ts", + "packages/time/src/date/startOf/tests/startOf.test.ts", + "packages/time/src/date/subtract/tests/subtract.test.ts", + "packages/time/src/date/until/tests/until.test.ts" + ] + }, + { + "name": "@tanstack/time-devtools", + "path": "packages/time-devtools", + "exports": ["TimeDevtoolsCore"], + "dependencies": [ + "@tanstack/devtools-ui", + "@tanstack/devtools-utils", + "@tanstack/time", + "goober", + "solid-js" + ], + "devDependencies": ["rolldown-plugin-solid"], + "peerDependencies": [], + "internalDeps": [ + "@tanstack/devtools-ui", + "@tanstack/devtools-utils", + "@tanstack/time" + ], + "files": [ + "packages/time-devtools/src/index.ts", + "packages/time-devtools/src/production.ts", + "packages/time-devtools/src/styles/use-styles.ts" + ], + "tests": [] + } + ], + "edges": [ + { + "from": "@tanstack/react-time", + "to": "@tanstack/react-store", + "type": "dependency" + }, + { + "from": "@tanstack/react-time", + "to": "@tanstack/time", + "type": "dependency" + }, + { + "from": "@tanstack/react-time-devtools", + "to": "@tanstack/devtools-utils", + "type": "dependency" + }, + { + "from": "@tanstack/react-time-devtools", + "to": "@tanstack/time-devtools", + "type": "dependency" + }, + { + "from": "@tanstack/solid-time", + "to": "@tanstack/solid-store", + "type": "dependency" + }, + { + "from": "@tanstack/solid-time", + "to": "@tanstack/time", + "type": "dependency" + }, + { + "from": "@tanstack/solid-time-devtools", + "to": "@tanstack/devtools-utils", + "type": "dependency" + }, + { + "from": "@tanstack/solid-time-devtools", + "to": "@tanstack/time-devtools", + "type": "dependency" + }, + { + "from": "@tanstack/time", + "to": "@tanstack/devtools-event-client", + "type": "dependency" + }, + { + "from": "@tanstack/time", + "to": "@tanstack/store", + "type": "dependency" + }, + { + "from": "@tanstack/time-devtools", + "to": "@tanstack/devtools-ui", + "type": "dependency" + }, + { + "from": "@tanstack/time-devtools", + "to": "@tanstack/devtools-utils", + "type": "dependency" + }, + { + "from": "@tanstack/time-devtools", + "to": "@tanstack/time", + "type": "dependency" + } + ] +} diff --git a/.ai/spec-kit/api-design.md b/.ai/spec-kit/api-design.md new file mode 100644 index 00000000..a98c6574 --- /dev/null +++ b/.ai/spec-kit/api-design.md @@ -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. diff --git a/.ai/spec-kit/architecture.md b/.ai/spec-kit/architecture.md new file mode 100644 index 00000000..0f6e7e28 --- /dev/null +++ b/.ai/spec-kit/architecture.md @@ -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` — concrete calendar with events, resources, availability +- `useCalendar` — React hook that instantiates CalendarCore and provides reactive selectors diff --git a/.ai/spec-kit/calendar-domain.md b/.ai/spec-kit/calendar-domain.md new file mode 100644 index 00000000..d9ce8e30 --- /dev/null +++ b/.ai/spec-kit/calendar-domain.md @@ -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. diff --git a/.ai/spec-kit/testing.md b/.ai/spec-kit/testing.md new file mode 100644 index 00000000..12fc4dd2 --- /dev/null +++ b/.ai/spec-kit/testing.md @@ -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:eslint` — linting +- `pnpm test:ci` — full CI suite (eslint, 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. diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 00000000..c1ddb08a --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,17 @@ +{ + "$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 + } +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..9d08a1a8 --- /dev/null +++ b/.editorconfig @@ -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 diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..e2ea8ad3 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +github: tannerlinsley diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000..cb3fd88b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,100 @@ +name: '🐛 Bug report' +description: Report a reproducible bug or regression +body: + - type: markdown + attributes: + value: | + Thank you for reporting an issue :pray:. + + This issue tracker is for reporting reproducible bugs or regression's found in [time](https://github.com/tanstack/time) + If you have a question about how to achieve or implement something and are struggling, please post a question + inside of time's [Discussions tab](https://github.com/tanstack/time/discussions) instead of filing an issue. + + Before submitting a new bug/issue, please check the links below to see if there is a solution or question posted there already: + - TanStack time's [Discussions tab](https://github.com/tanstack/time/discussions) + - TanStack time's [Open Issues](https://github.com/tanstack/time/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) + - TanStack time's [Closed Issues](https://github.com/tanstack/time/issues?q=is%3Aissue+sort%3Aupdated-desc+is%3Aclosed) + + The more information you fill in, the better the community can help you. + + - type: input + id: tanstack-time-version + attributes: + label: TanStack Time version + description: | + - Please let us know the exact version of the TanStack Time framework adapter that you were using when the issue occurred. If you are using an older version, check to see if your bug has already been solved in the latest version. Please don't just put in "latest", as this is subject to change. + - The latest "time" version is + placeholder: | + e.g. v0.0.1 + validations: + required: true + + - type: input + id: framework-library-version + attributes: + label: Framework/Library version + description: Which framework and what version of that framework are you using? + placeholder: | + e.g. React v19.2.3 + validations: + required: true + + - type: textarea + id: description + attributes: + label: Describe the bug and the steps to reproduce it + description: Provide a clear and concise description of the challenge you are running into, and the steps we should take to try to reproduce your bug. + validations: + required: true + + - type: input + id: link + attributes: + label: Your Minimal, Reproducible Example - (Sandbox Highly Recommended) + description: | + Please add a link to a minimal reproduction. + Note: + - Your bug may get fixed much faster if we can run your code and it doesn't have dependencies other than React. + - To create a shareable code example for web, you can use CodeSandbox (https://codesandbox.io/s/new) or Stackblitz (https://stackblitz.com/). + - Please make sure the example is complete and runnable without prior dependencies and free of unnecessary abstractions + - Feel free to fork any of the official CodeSandbox examples to reproduce your issue: https://github.com/tanstack/time/tree/main/examples/ + - For React Native, you can use: https://snack.expo.dev/ + - For TypeScript related issues only, a TypeScript Playground link might be sufficient: https://www.typescriptlang.org/play + - Please read these tips for providing a minimal example: https://stackoverflow.com/help/mcve. + placeholder: | + e.g. Code Sandbox, Stackblitz, TypeScript Playground, etc. + validations: + required: true + + - type: textarea + id: screenshots_or_videos + attributes: + label: Screenshots or Videos (Optional) + description: | + If applicable, add screenshots or a video to help explain your problem. + For more information on the supported file image/file types and the file size limits, please refer + to the following link: https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/attaching-files + placeholder: | + You can drag your video or image files inside of this editor ↓ + + - type: dropdown + attributes: + options: + - No, because I do not know how + - No, because I do not have time to dig into it + - Maybe, I'll investigate and start debugging + - Yes, I think I know how to fix it and will discuss it in the comments of this issue + - Yes, I am also opening a PR that solves the problem along side this issue + label: Do you intend to try to help solve this bug with your own PR? + description: | + If you think you know the cause of the problem, the fastest way to get it fixed is to suggest a fix, or fix it yourself! However, it is ok if you cannot solve this yourself and are just wanting help. + - type: checkboxes + id: agrees-to-terms + attributes: + label: Terms & Code of Conduct + description: By submitting this issue, you agree to follow our Code of Conduct and can verify that you have followed the requirements outlined above to the best of your ability. + options: + - label: I agree to follow this project's Code of Conduct + required: true + - label: I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed. + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..d47ed610 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,11 @@ +blank_issues_enabled: false +contact_links: + - name: 🤔 Feature Requests & Questions + url: https://github.com/TanStack/time/discussions + about: Please ask and answer questions here. + - name: 💬 Community Chat + url: https://discord.gg/mQd7egN + about: A dedicated discord server hosted by TanStack + - name: 🦋 TanStack Bluesky + url: https://bsky.app/profile/tanstack.com + about: Stay up to date with new releases of our libraries diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..0262cea3 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,13 @@ +## 🎯 Changes + + + +## ✅ Checklist + +- [ ] I have followed the steps in the [Contributing guide](https://github.com/TanStack/time/blob/main/CONTRIBUTING.md). +- [ ] I have tested this code locally with `pnpm run test:pr`. + +## 🚀 Release Impact + +- [ ] This change affects published code, and I have generated a [changeset](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md). +- [ ] This change is docs/CI/dev-only (no release). diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 00000000..fb2083cf --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "configMigration": true, + "extends": [ + "config:recommended", + "group:allNonMajor", + "schedule:weekly", + ":approveMajorUpdates", + ":automergeMinor", + ":disablePeerDependencies", + ":maintainLockFilesMonthly", + ":semanticCommits", + ":semanticCommitTypeAll(chore)" + ], + "ignorePresets": [":ignoreModulesAndTests"], + "labels": ["dependencies"], + "rangeStrategy": "bump", + "postUpdateOptions": ["pnpmDedupe"], + "ignoreDeps": ["@types/node", "node"] +} diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml new file mode 100644 index 00000000..12dceb88 --- /dev/null +++ b/.github/workflows/autofix.yml @@ -0,0 +1,33 @@ +name: autofix.ci # needed to securely identify the workflow + +on: + pull_request: + push: + branches: [main, alpha, beta, rc] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.ref }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + autofix: + name: autofix + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Setup Tools + uses: tanstack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main + - name: Fix formatting + run: pnpm run format + - name: Regenerate docs + run: pnpm build:all && pnpm generate-docs + - name: Apply fixes + uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27 + with: + commit-message: 'ci: apply automated fixes' diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 00000000..128fe388 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,52 @@ +name: PR + +on: + pull_request: + paths-ignore: + - 'docs/**' + - 'media/**' + - '**/*.md' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.ref }} + cancel-in-progress: true + +env: + NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} + +permissions: + contents: read + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 + persist-credentials: false + - name: Setup Tools + uses: tanstack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main + - name: Get base and head commits for `nx affected` + uses: nrwl/nx-set-shas@3e9ad7370203c1e93d109be57f3b72eb0eb511b1 # v4.4.0 + with: + main-branch-name: main + - name: Run Checks + run: pnpm run test:pr + preview: + name: Preview + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 + persist-credentials: false + - name: Setup Tools + uses: tanstack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main + - name: Build Packages + run: pnpm run build:all + - name: Publish Previews + run: pnpx pkg-pr-new publish --pnpm './packages/*' --template './examples/*/*' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..6f9391b4 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: Release + +on: + push: + # branches: [main, alpha, beta, rc] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.ref }} + cancel-in-progress: true + +env: + NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} + +permissions: + contents: write + id-token: write + pull-requests: write + +jobs: + release: + name: Release + if: github.repository_owner == 'TanStack' + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 + persist-credentials: false + - name: Setup Tools + uses: tanstack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main + - name: Run Tests + run: pnpm run test:ci + - name: Run Changesets (version or publish) + uses: changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba # v1.5.3 + with: + version: pnpm run changeset:version + publish: pnpm run changeset:publish + commit: 'ci: Version Packages' + title: 'ci: Version Packages' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml new file mode 100644 index 00000000..ba8e8cfa --- /dev/null +++ b/.github/workflows/zizmor.yml @@ -0,0 +1,25 @@ +name: GitHub Actions Security Analysis + +on: + push: + branches: [alpha] + pull_request: + branches: ['**'] + +permissions: {} + +jobs: + zizmor: + name: Run zizmor + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Run zizmor + uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3 + with: + advanced-security: false + annotations: true diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..3005d7b6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,63 @@ + +# See https://help.github.com/ignore-files/ for more about ignoring files. + +# dependencies +node_modules +package-lock.json +yarn.lock + +# builds +build +dist +lib +es +artifacts +.rpt2_cache +coverage +*.tgz + +# misc +.DS_Store +.env +.env.local +.env.development.local +.env.test.local +.env.production.local +.next +.svelte-kit + +# developer-specific VS Code config files +.vscode/tasks.json +.vscode/launch.json + +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.history +size-plugin.json +stats-hydration.json +stats-react.json +stats.html +.vscode/settings.json +.idea +.cursor +.claude + +*.log +.DS_Store +.cache +.idea +.pnpm-store + +package-lock.json +yarn.lock +*.tsbuildinfo +*.tsbuildinfo + +.svelte-kit +.nx/cache +.nx/workspace-data +vite.config.js.timestamp-* +vite.config.ts.timestamp-* + +.angular diff --git a/.npmrc b/.npmrc new file mode 100644 index 00000000..268c392d --- /dev/null +++ b/.npmrc @@ -0,0 +1 @@ +provenance=true diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..b4040276 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +24.8.0 diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..fe4bf24f --- /dev/null +++ b/.prettierignore @@ -0,0 +1,11 @@ +**/.nx/ +**/.nx/cache +**/.svelte-kit +**/build +**/coverage +**/dist +**/docs +**/old-examples +pnpm-lock.yaml + +.angular diff --git a/.specify/README.md b/.specify/README.md new file mode 100644 index 00000000..b16931ae --- /dev/null +++ b/.specify/README.md @@ -0,0 +1,70 @@ +# Spec Kit — TanStack Time + +This is the Spec-Driven Development (SDD) infrastructure for TanStack Time, following the [github/spec-kit](https://github.com/github/spec-kit) methodology. + +## Workflow + +``` +/speckit.constitution → /speckit.specify → /speckit.clarify (optional) + ↓ + /speckit.plan → /speckit.analyze (optional) → /speckit.tasks + ↓ + /speckit.implement +``` + +## Directory Structure + +``` +.specify/ + memory/ + constitution.md # Project principles (read first, always) + scripts/bash/ + common.sh # Shared utilities + create-new-feature.sh # Scaffolds specs/-/ + setup-plan.sh # Scaffolds plan.md + setup-tasks.sh # Scaffolds tasks.md + templates/ + constitution-template.md + spec-template.md + plan-template.md + tasks-template.md + +specs/ + 001-/ # Feature specs live here + spec.md # Functional requirements + plan.md # Technical implementation + tasks.md # Actionable task breakdown + contracts/ # API contracts, data models + +.claude/commands/ + speckit-constitution.md # /speckit.constitution + speckit-specify.md # /speckit.specify + speckit-clarify.md # /speckit.clarify + speckit-plan.md # /speckit.plan + speckit-analyze.md # /speckit.analyze + speckit-tasks.md # /speckit.tasks + speckit-implement.md # /speckit.implement +``` + +## Commands + +| Command | Purpose | When to run | +| ----------------------- | -------------------------------- | ----------------------------- | +| `/speckit.constitution` | Create/update project principles | First, before any feature | +| `/speckit.specify` | Write functional requirements | For each new feature | +| `/speckit.clarify` | Ask clarifying questions | After specify, before plan | +| `/speckit.plan` | Write technical plan | After clarify/specify | +| `/speckit.analyze` | Check spec-plan-task coverage | After tasks, before implement | +| `/speckit.tasks` | Break plan into tasks | After plan | +| `/speckit.implement` | Execute task breakdown | After tasks | + +## Constitution + +Read `.specify/memory/constitution.md` before any development. It defines: + +- Zero comments in source code +- Headless core, thin adapters +- No Temporal leakage in public API +- Immutable inputs +- Treeshakable standalone functions +- Test-first for all public functions diff --git a/.specify/memory/constitution.md b/.specify/memory/constitution.md new file mode 100644 index 00000000..db1644c5 --- /dev/null +++ b/.specify/memory/constitution.md @@ -0,0 +1,41 @@ +# TanStack Time Constitution + +## Purpose + +TanStack Time is a headless, framework-agnostic date/time and calendar utility library. It provides the core logic for building time and calendar UI components across React, Solid, Vue, Svelte, and Angular. It is designed after TanStack Query and TanStack Table: a powerful, treeshakable core with thin framework adapters. + +## Core Principles + +1. **Headless First**: All UI logic lives in the core. Framework adapters are thin reactive wrappers. +2. **Temporal Accuracy**: Date/time instances are relative to timezone and calendar. Never treat them as static points. +3. **Zero Comments**: Source code contains no comments. Prefer names, types, structure, and tests. +4. **Treeshakable**: Prefer standalone functions over fluent APIs. Each function is idempotent and composable. +5. **No Temporal Leakage**: Public API returns Date or string. Never expose Temporal objects to consumers. +6. **Immutable Inputs**: Never mutate Date objects passed into the API. Always clone or create new Temporal instances. +7. **Standards-Based**: Use RFC 3339 for serialization, Intl.DateTimeFormat for display, and the Temporal polyfill for computation. + +## Quality Standards + +- **Testing**: Every public function must have co-located unit tests using Vitest. React hooks tested with `@testing-library/react`. +- **Type Safety**: All public APIs fully typed. No `any` in the public surface. Generics for calendar resources and events. +- **Performance**: Date primitives should be fast enough for frequent re-renders. Avoid creating unnecessary Temporal objects. +- **Edge Cases**: Handle leap years, timezone transitions, and calendar variants correctly. +- **CI Gate**: `pnpm test:pr` (eslint, sherif, knip, docs, lib, types, build) must pass before merge. + +## Technical Decisions + +- **Monorepo**: pnpm workspaces + nx for task orchestration and caching. +- **Build**: `tsdown` produces ESM + CJS for each package. +- **State**: `@tanstack/store` in core. `@tanstack/react-store` in React adapter. +- **Temporal**: `@js-temporal/polyfill` until native browser support. +- **Formatting**: Intl.DateTimeFormat parts, not string tokens. +- **Date Input**: Accept RFC 3339 string, epoch milliseconds, or Date object. + +## Process Rules + +1. **No comments in source code**. If a constraint is non-obvious, encode it in the type system or test. +2. **Small focused functions over classes**. Only use classes where state management is necessary (CalendarCore, DateCore). +3. **When changing core, check all adapters**. react-time, solid-time, and devtools must remain compatible. +4. **Run tests before declaring done**. `pnpm test:lib` and `pnpm test:types`. +5. **All new date logic must handle timezone and calendar correctly**. +6. **Prefer improving names, types, APIs, structure, and tests over adding comments**. diff --git a/.specify/scripts/bash/common.sh b/.specify/scripts/bash/common.sh new file mode 100644 index 00000000..7a7cb6b4 --- /dev/null +++ b/.specify/scripts/bash/common.sh @@ -0,0 +1,34 @@ +#!/bin/bash +set -euo pipefail + +ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../.." && pwd)" +SPECS_DIR="${ROOT_DIR}/specs" +SPECIFY_DIR="${ROOT_DIR}/.specify" +MEMORY_DIR="${SPECIFY_DIR}/memory" +TEMPLATES_DIR="${SPECIFY_DIR}/templates" + +next_feature_id() { + local max_id=0 + for dir in "${SPECS_DIR}"/*/; do + if [ -d "$dir" ]; then + local id=$(basename "$dir" | cut -d'-' -f1) + if [[ "$id" =~ ^[0-9]+$ ]]; then + if [ "$id" -gt "$max_id" ]; then + max_id=$id + fi + fi + fi + done + printf "%03d" $((max_id + 1)) +} + +slugify() { + echo "$1" | tr '[:upper:]' '[:lower:]' | tr ' ' '-' | tr -cd '[:alnum:]-' | sed 's/-*$//' +} + +check_prerequisites() { + if [ ! -f "${MEMORY_DIR}/constitution.md" ]; then + echo "ERROR: No constitution found. Run /speckit.constitution first." + exit 1 + fi +} diff --git a/.specify/scripts/bash/create-new-feature.sh b/.specify/scripts/bash/create-new-feature.sh new file mode 100644 index 00000000..bec03212 --- /dev/null +++ b/.specify/scripts/bash/create-new-feature.sh @@ -0,0 +1,50 @@ +#!/bin/bash +set -euo pipefail + +source "$(dirname "$0")/common.sh" + +FEATURE_NAME="${1:-}" +if [ -z "$FEATURE_NAME" ]; then + echo "Usage: $0 " + exit 1 +fi + +ID=$(next_feature_id) +SLUG=$(slugify "$FEATURE_NAME") +FEATURE_DIR="${SPECS_DIR}/${ID}-${SLUG}" + +mkdir -p "$FEATURE_DIR" + +cat > "${FEATURE_DIR}/spec.md" <" + exit 1 +fi + +cat > "${FEATURE_DIR}/plan.md" <" + exit 1 +fi + +cat > "${FEATURE_DIR}/tasks.md" < + +Defined in: [calendar/calendar.ts:338](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L338) + +## Extends + +- [`DateCore`](DateCore.md) + +## Type Parameters + +### TResource + +`TResource` *extends* [`Resource`](../interfaces/Resource.md) + +### TEvent + +`TEvent` *extends* [`Event`](../interfaces/Event.md)\<`TResource`\> + +## Implements + +- `CalendarActions`\<`TResource`, `TEvent`\> + +## Constructors + +### Constructor + +```ts +new CalendarCore(options): CalendarCore; +``` + +Defined in: [calendar/calendar.ts:405](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L405) + +#### Parameters + +##### options + +[`CalendarCoreOptions`](../interfaces/CalendarCoreOptions.md)\<`TResource`, `TEvent`\> + +#### Returns + +`CalendarCore`\<`TResource`, `TEvent`\> + +#### Overrides + +[`DateCore`](DateCore.md).[`constructor`](DateCore.md#constructor) + +## Properties + +### formatters + +```ts +formatters: object; +``` + +Defined in: [calendar/date-core.ts:81](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L81) + +#### date + +```ts +date: DateTimeFormat; +``` + +#### dateTime + +```ts +dateTime: DateTimeFormat; +``` + +#### time + +```ts +time: DateTimeFormat; +``` + +#### Inherited from + +[`DateCore`](DateCore.md).[`formatters`](DateCore.md#formatters) + +*** + +### options + +```ts +options: ParsedCalendarCoreOptions; +``` + +Defined in: [calendar/calendar.ts:345](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L345) + +#### Overrides + +[`DateCore`](DateCore.md).[`options`](DateCore.md#options) + +*** + +### store + +```ts +store: Store; +``` + +Defined in: [calendar/date-core.ts:79](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L79) + +#### Inherited from + +[`DateCore`](DateCore.md).[`store`](DateCore.md#store) + +## Methods + +### addEvent() + +```ts +addEvent(event, options?): Promise; +``` + +Defined in: [calendar/calendar.ts:2159](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L2159) + +Fetches events for the event's date range, validates placement +constraints, and adds the event if valid. Returns a result +indicating success or a validation error. + +#### Parameters + +##### event + +`TEvent` + +##### options? + +###### dependsOn? + +[`EventDependency`](../interfaces/EventDependency.md)[] + +#### Returns + +`Promise`\<[`SaveEventResult`](../type-aliases/SaveEventResult.md)\> + +#### Implementation of + +```ts +CalendarActions.addEvent +``` + +*** + +### canGoNextPeriod() + +```ts +canGoNextPeriod(): boolean; +``` + +Defined in: [calendar/date-core.ts:446](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L446) + +#### Returns + +`boolean` + +#### Implementation of + +```ts +CalendarActions.canGoNextPeriod +``` + +#### Inherited from + +[`DateCore`](DateCore.md).[`canGoNextPeriod`](DateCore.md#cangonextperiod) + +*** + +### canGoPreviousPeriod() + +```ts +canGoPreviousPeriod(): boolean; +``` + +Defined in: [calendar/date-core.ts:415](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L415) + +#### Returns + +`boolean` + +#### Implementation of + +```ts +CalendarActions.canGoPreviousPeriod +``` + +#### Inherited from + +[`DateCore`](DateCore.md).[`canGoPreviousPeriod`](DateCore.md#cangopreviousperiod) + +*** + +### canRedo() + +```ts +canRedo(): boolean; +``` + +Defined in: [calendar/calendar.ts:985](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L985) + +Returns true when there is at least one action to redo. + +#### Returns + +`boolean` + +#### Implementation of + +```ts +CalendarActions.canRedo +``` + +*** + +### canUndo() + +```ts +canUndo(): boolean; +``` + +Defined in: [calendar/calendar.ts:981](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L981) + +Returns true when there is at least one action to undo. + +#### Returns + +`boolean` + +#### Implementation of + +```ts +CalendarActions.canUndo +``` + +*** + +### changeViewMode() + +```ts +changeViewMode(newViewMode): void; +``` + +Defined in: [calendar/date-core.ts:266](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L266) + +#### Parameters + +##### newViewMode + +[`ViewMode`](../interfaces/ViewMode.md) + +#### Returns + +`void` + +#### Implementation of + +```ts +CalendarActions.changeViewMode +``` + +#### Inherited from + +[`DateCore`](DateCore.md).[`changeViewMode`](DateCore.md#changeviewmode) + +*** + +### commitAdd() + +```ts +commitAdd(event): void; +``` + +Defined in: [calendar/calendar.ts:1032](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L1032) + +#### Parameters + +##### event + +`TEvent` + +#### Returns + +`void` + +*** + +### commitUpdate() + +```ts +commitUpdate(id, updates): void; +``` + +Defined in: [calendar/calendar.ts:1054](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L1054) + +#### Parameters + +##### id + +`string` + +##### updates + +`Partial`\<`Omit`\<`TEvent`, `"id"`\>\> + +#### Returns + +`void` + +*** + +### createDependency() + +```ts +createDependency( + sourceId, + targetId, + type): object; +``` + +Defined in: [calendar/calendar.ts:2660](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L2660) + +Creates a dependency link from source to target event. +If the target event starts before the source event ends, it will optionally reschedule the target. + +#### Parameters + +##### sourceId + +`string` + +##### targetId + +`string` + +##### type + +[`DependencyType`](../type-aliases/DependencyType.md) = `'FS'` + +#### Returns + +`object` + +##### blocked + +```ts +blocked: boolean; +``` + +##### error? + +```ts +optional error: ResizeError; +``` + +#### Implementation of + +```ts +CalendarActions.createDependency +``` + +*** + +### createResizeController() + +```ts +createResizeController(options): ResizeController; +``` + +Defined in: [calendar/calendar.ts:1846](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L1846) + +#### Parameters + +##### options + +[`ResizeControllerOptions`](../interfaces/ResizeControllerOptions.md) = `{}` + +#### Returns + +[`ResizeController`](ResizeController.md)\<`TResource`, `TEvent`\> + +*** + +### editEvent() + +```ts +editEvent( + eventId, + updates, +options?): Promise; +``` + +Defined in: [calendar/calendar.ts:2213](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L2213) + +Fetches events for the event's date range, validates move constraints +(and cascading dependents), and updates the event if valid. +Returns a result indicating success or a validation error. + +#### Parameters + +##### eventId + +`string` + +##### updates + +`Partial`\<`Omit`\<`TEvent`, `"id"`\>\> + +##### options? + +###### dependsOn? + +[`EventDependency`](../interfaces/EventDependency.md)[] + +#### Returns + +`Promise`\<[`SaveEventResult`](../type-aliases/SaveEventResult.md)\> + +#### Implementation of + +```ts +CalendarActions.editEvent +``` + +*** + +### editRecurringEvent() + +```ts +editRecurringEvent( + eventId, + updates, +options): Promise; +``` + +Defined in: [calendar/calendar.ts:2311](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L2311) + +Edits one occurrence, this-and-following occurrences, or the whole recurring series. + +#### Parameters + +##### eventId + +`string` + +##### updates + +`Partial`\<`Omit`\<`TEvent`, `"id"`\>\> + +##### options + +###### dependsOn? + +[`EventDependency`](../interfaces/EventDependency.md)[] + +###### occurrenceStart? + +[`EventDateTimeInput`](../type-aliases/EventDateTimeInput.md) + +###### scope + +[`RecurrenceEditScope`](../type-aliases/RecurrenceEditScope.md) + +#### Returns + +`Promise`\<[`SaveEventResult`](../type-aliases/SaveEventResult.md)\> + +#### Implementation of + +```ts +CalendarActions.editRecurringEvent +``` + +*** + +### ensureRangeLoaded() + +```ts +ensureRangeLoaded(): void; +``` + +Defined in: [calendar/calendar.ts:703](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L703) + +#### Returns + +`void` + +*** + +### fetchEventsForRange() + +```ts +fetchEventsForRange(start, end): Promise; +``` + +Defined in: [calendar/calendar.ts:817](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L817) + +Fetches events for an arbitrary date range from the configured +`fetchEvents` callback and merges them into the calendar. +Resolves immediately if `fetchEvents` is not configured or the range +is already loaded. + +#### Parameters + +##### start + +`string` + +##### end + +`string` + +#### Returns + +`Promise`\<`void`\> + +#### Implementation of + +```ts +CalendarActions.fetchEventsForRange +``` + +*** + +### formatCurrentPeriod() + +```ts +formatCurrentPeriod(options?): string; +``` + +Defined in: [calendar/calendar.ts:887](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L887) + +Formats the current period as a human-readable "Month Year" string (e.g. "January 2024"). + +#### Parameters + +##### options? + +###### locale? + +`string` + +#### Returns + +`string` + +#### Implementation of + +```ts +CalendarActions.formatCurrentPeriod +``` + +*** + +### formatDate() + +```ts +formatDate(date): string; +``` + +Defined in: [calendar/date-core.ts:132](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L132) + +#### Parameters + +##### date + +[`DateInput`](../type-aliases/DateInput.md) + +#### Returns + +`string` + +#### Inherited from + +[`DateCore`](DateCore.md).[`formatDate`](DateCore.md#formatdate) + +*** + +### formatDateTime() + +```ts +formatDateTime(date): string; +``` + +Defined in: [calendar/date-core.ts:140](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L140) + +#### Parameters + +##### date + +[`DateInput`](../type-aliases/DateInput.md) + +#### Returns + +`string` + +#### Inherited from + +[`DateCore`](DateCore.md).[`formatDateTime`](DateCore.md#formatdatetime) + +*** + +### formatPeriodLabel() + +```ts +formatPeriodLabel(options?): string; +``` + +Defined in: [calendar/calendar.ts:868](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L868) + +Returns a human-readable label for the currently visible date range. + +#### Parameters + +##### options? + +###### locale? + +`string` + +#### Returns + +`string` + +#### Implementation of + +```ts +CalendarActions.formatPeriodLabel +``` + +*** + +### formatTime() + +```ts +formatTime(date): string; +``` + +Defined in: [calendar/date-core.ts:136](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L136) + +#### Parameters + +##### date + +[`DateInput`](../type-aliases/DateInput.md) + +#### Returns + +`string` + +#### Inherited from + +[`DateCore`](DateCore.md).[`formatTime`](DateCore.md#formattime) + +*** + +### getAllDayEventsByDate() + +```ts +getAllDayEventsByDate(date): TEvent[]; +``` + +Defined in: [calendar/calendar.ts:953](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L953) + +Retrieves all-day events occurring on a specific date (multi-day all-day segments included). + +#### Parameters + +##### date + +`string` + +#### Returns + +`TEvent`[] + +#### Implementation of + +```ts +CalendarActions.getAllDayEventsByDate +``` + +*** + +### getCalendarDays() + +```ts +protected getCalendarDays(): PlainDate[]; +``` + +Defined in: [calendar/calendar.ts:595](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L595) + +#### Returns + +`PlainDate`[] + +#### Overrides + +[`DateCore`](DateCore.md).[`getCalendarDays`](DateCore.md#getcalendardays) + +*** + +### getDaysInRange() + +```ts +getDaysInRange(start, end): object[]; +``` + +Defined in: [calendar/calendar.ts:774](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L774) + +Returns Day objects for every date between `start` and `end` (inclusive), +derived freshly from the current event state. Use this when rendering a +buffered range that spans multiple periods (e.g. infinite scroll) so +mutations (add/edit/remove) are reflected without manual cache invalidation. + +#### Parameters + +##### start + +`string` + +##### end + +`string` + +#### Returns + +`object`[] + +#### Implementation of + +```ts +CalendarActions.getDaysInRange +``` + +*** + +### getDaysNames() + +```ts +getDaysNames(weekday): string[]; +``` + +Defined in: [calendar/date-core.ts:255](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L255) + +#### Parameters + +##### weekday + +`"long"` | `"short"` + +#### Returns + +`string`[] + +#### Implementation of + +```ts +CalendarActions.getDaysNames +``` + +#### Inherited from + +[`DateCore`](DateCore.md).[`getDaysNames`](DateCore.md#getdaysnames) + +*** + +### getDaysWithEvents() + +```ts +getDaysWithEvents(): object[]; +``` + +Defined in: [calendar/calendar.ts:764](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L764) + +#### Returns + +`object`[] + +*** + +### getEventProps() + +```ts +getEventProps(event): object; +``` + +Defined in: [calendar/calendar.ts:913](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L913) + +Retrieves styling properties for a specific event. + +#### Parameters + +##### event + +`TEvent` + +#### Returns + +`object` + +##### end + +```ts +end: string; +``` + +##### isSplitEvent + +```ts +isSplitEvent: boolean; +``` + +##### overlappingEvents + +```ts +overlappingEvents: TEvent[]; +``` + +##### start + +```ts +start: string; +``` + +##### style? + +```ts +optional style: object; +``` + +###### style.height + +```ts +height: string; +``` + +###### style.left + +```ts +left: string; +``` + +###### style.top + +```ts +top: string; +``` + +###### style.width + +```ts +width: string; +``` + +#### Implementation of + +```ts +CalendarActions.getEventProps +``` + +*** + +### getEvents() + +```ts +getEvents(): TEvent[]; +``` + +Defined in: [calendar/calendar.ts:1557](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L1557) + +Returns a snapshot of all events currently managed by the calendar (including those outside the visible range). + +#### Returns + +`TEvent`[] + +#### Implementation of + +```ts +CalendarActions.getEvents +``` + +*** + +### getEventsByDate() + +```ts +getEventsByDate(date): TEvent[]; +``` + +Defined in: [calendar/calendar.ts:941](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L941) + +Retrieves all events for a specific date. + +#### Parameters + +##### date + +`string` + +#### Returns + +`TEvent`[] + +#### Implementation of + +```ts +CalendarActions.getEventsByDate +``` + +*** + +### getEventsByResource() + +```ts +getEventsByResource(): Map; +``` + +Defined in: [calendar/calendar.ts:3021](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L3021) + +Groups visible events by resource, merging multi-day segments back to full-span events. + +#### Returns + +`Map`\<`TResource`\[`"id"`\], `TEvent`[]\> + +#### Implementation of + +```ts +CalendarActions.getEventsByResource +``` + +*** + +### getEventSegmentInfo() + +```ts +getEventSegmentInfo(event): SegmentInfo; +``` + +Defined in: [calendar/calendar.ts:900](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L900) + +Returns segment info (split/occurrence metadata) for an event, normalising flexible datetime inputs. + +#### Parameters + +##### event + +`TEvent` + +#### Returns + +[`SegmentInfo`](../interfaces/SegmentInfo.md) + +#### Implementation of + +```ts +CalendarActions.getEventSegmentInfo +``` + +*** + +### getFirstDayOfMonth() + +```ts +protected getFirstDayOfMonth(): PlainDate; +``` + +Defined in: [calendar/date-core.ts:144](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L144) + +#### Returns + +`PlainDate` + +#### Inherited from + +[`DateCore`](DateCore.md).[`getFirstDayOfMonth`](DateCore.md#getfirstdayofmonth) + +*** + +### getFirstDayOfWeek() + +```ts +protected getFirstDayOfWeek(): PlainDate; +``` + +Defined in: [calendar/date-core.ts:152](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L152) + +#### Returns + +`PlainDate` + +#### Inherited from + +[`DateCore`](DateCore.md).[`getFirstDayOfWeek`](DateCore.md#getfirstdayofweek) + +*** + +### getLoadedRanges() + +```ts +getLoadedRanges(): readonly object[]; +``` + +Defined in: [calendar/calendar.ts:813](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L813) + +#### Returns + +readonly `object`[] + +*** + +### getMasterEvent() + +```ts +getMasterEvent(event): TEvent; +``` + +Defined in: [calendar/calendar.ts:1552](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L1552) + +Returns the master event for a given occurrence (or the event itself if it is already the master). + +#### Parameters + +##### event + +`TEvent` + +#### Returns + +`TEvent` + +#### Implementation of + +```ts +CalendarActions.getMasterEvent +``` + +*** + +### getTimelineLayout() + +```ts +getTimelineLayout(): TimelineLayout; +``` + +Defined in: [calendar/calendar.ts:3025](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L3025) + +Computes horizontal timeline layout with event positions, lane assignments, and current time marker. + +#### Returns + +[`TimelineLayout`](../interfaces/TimelineLayout.md)\<`TResource`, `TEvent`\> + +#### Implementation of + +```ts +CalendarActions.getTimelineLayout +``` + +*** + +### getTimeSlots() + +```ts +getTimeSlots(options?): TimeSlot[]; +``` + +Defined in: [calendar/calendar.ts:937](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L937) + +Retrieves time slots for day view with configurable intervals. + +#### Parameters + +##### options? + +`TimeSlotOptions` + +#### Returns + +[`TimeSlot`](../interfaces/TimeSlot.md)[] + +#### Implementation of + +```ts +CalendarActions.getTimeSlots +``` + +*** + +### getUnavailabilityDetails() + +```ts +getUnavailabilityDetails( + date, + startMinutes, + endMinutes, + options?): object[]; +``` + +Defined in: [calendar/calendar.ts:2906](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L2906) + +#### Parameters + +##### date + +`string` + +##### startMinutes + +`number` + +##### endMinutes + +`number` + +##### options? + +###### resourceIds? + +`TResource`\[`"id"`\][] + +#### Returns + +`object`[] + +*** + +### getUnavailableRanges() + +```ts +getUnavailableRanges(date, options?): UnavailableRange[]; +``` + +Defined in: [calendar/calendar.ts:2817](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L2817) + +Retrieves unavailable time ranges for a specific date based on resource availability. + +#### Parameters + +##### date + +`string` + +##### options? + +###### containerHeight? + +`number` + +###### resourceIds? + +`TResource`\[`"id"`\][] + +#### Returns + +[`UnavailableRange`](../interfaces/UnavailableRange.md)[] + +#### Implementation of + +```ts +CalendarActions.getUnavailableRanges +``` + +*** + +### getWeekStartsOn() + +```ts +getWeekStartsOn(): number; +``` + +Defined in: [calendar/date-core.ts:159](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L159) + +#### Returns + +`number` + +#### Inherited from + +[`DateCore`](DateCore.md).[`getWeekStartsOn`](DateCore.md#getweekstartson) + +*** + +### goToCurrentPeriod() + +```ts +goToCurrentPeriod(): void; +``` + +Defined in: [calendar/date-core.ts:376](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L376) + +#### Returns + +`void` + +#### Implementation of + +```ts +CalendarActions.goToCurrentPeriod +``` + +#### Inherited from + +[`DateCore`](DateCore.md).[`goToCurrentPeriod`](DateCore.md#gotocurrentperiod) + +*** + +### goToNextOccurrence() + +```ts +goToNextOccurrence(eventId, fromDate?): void; +``` + +Defined in: [calendar/calendar.ts:1798](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L1798) + +Navigates to the next occurrence of a recurring event after fromDate (defaults to activeDate). +No-op when the event is not recurring or has no future occurrences. + +#### Parameters + +##### eventId + +`string` + +##### fromDate? + +[`EventDateTimeInput`](../type-aliases/EventDateTimeInput.md) + +#### Returns + +`void` + +#### Implementation of + +```ts +CalendarActions.goToNextOccurrence +``` + +*** + +### goToNextPeriod() + +```ts +goToNextPeriod(): void; +``` + +Defined in: [calendar/date-core.ts:328](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L328) + +#### Returns + +`void` + +#### Implementation of + +```ts +CalendarActions.goToNextPeriod +``` + +#### Inherited from + +[`DateCore`](DateCore.md).[`goToNextPeriod`](DateCore.md#gotonextperiod) + +*** + +### goToPreviousOccurrence() + +```ts +goToPreviousOccurrence(eventId, fromDate?): void; +``` + +Defined in: [calendar/calendar.ts:1822](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L1822) + +Navigates to the previous occurrence of a recurring event before fromDate (defaults to activeDate). +No-op when the event is not recurring or is already at the first occurrence. + +#### Parameters + +##### eventId + +`string` + +##### fromDate? + +[`EventDateTimeInput`](../type-aliases/EventDateTimeInput.md) + +#### Returns + +`void` + +#### Implementation of + +```ts +CalendarActions.goToPreviousOccurrence +``` + +*** + +### goToPreviousPeriod() + +```ts +goToPreviousPeriod(): void; +``` + +Defined in: [calendar/date-core.ts:280](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L280) + +#### Returns + +`void` + +#### Implementation of + +```ts +CalendarActions.goToPreviousPeriod +``` + +#### Inherited from + +[`DateCore`](DateCore.md).[`goToPreviousPeriod`](DateCore.md#gotopreviousperiod) + +*** + +### goToSpecificPeriod() + +```ts +goToSpecificPeriod(date): void; +``` + +Defined in: [calendar/date-core.ts:394](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L394) + +#### Parameters + +##### date + +[`DateInput`](../type-aliases/DateInput.md) + +#### Returns + +`void` + +#### Implementation of + +```ts +CalendarActions.goToSpecificPeriod +``` + +#### Inherited from + +[`DateCore`](DateCore.md).[`goToSpecificPeriod`](DateCore.md#gotospecificperiod) + +*** + +### groupDaysBy() + +```ts +groupDaysBy(__namedParameters): (Day | null)[][]; +``` + +Defined in: [calendar/calendar.ts:919](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L919) + +Groups days by a specified unit. + +#### Parameters + +##### \_\_namedParameters + +###### days + +([`Day`](../type-aliases/Day.md)\<`TResource`, `TEvent`\> \| `null`)[] + +###### fillMissingDays? + +`boolean` = `true` + +###### unit + +`"week"` \| `"workWeek"` + +#### Returns + +([`Day`](../type-aliases/Day.md)\<`TResource`, `TEvent`\> \| `null`)[][] + +#### Implementation of + +```ts +CalendarActions.groupDaysBy +``` + +*** + +### redo() + +```ts +redo(): void; +``` + +Defined in: [calendar/calendar.ts:1023](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L1023) + +Re-applies the last undone action. + +#### Returns + +`void` + +#### Implementation of + +```ts +CalendarActions.redo +``` + +*** + +### removeEvent() + +```ts +removeEvent(id): void; +``` + +Defined in: [calendar/calendar.ts:2790](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L2790) + +Removes an event by ID. + +#### Parameters + +##### id + +`string` + +#### Returns + +`void` + +#### Implementation of + +```ts +CalendarActions.removeEvent +``` + +*** + +### removeRecurringEvent() + +```ts +removeRecurringEvent(eventId, options): void; +``` + +Defined in: [calendar/calendar.ts:2581](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L2581) + +Removes one occurrence, this-and-following occurrences, or the whole recurring series. + +#### Parameters + +##### eventId + +`string` + +##### options + +###### occurrenceStart? + +[`EventDateTimeInput`](../type-aliases/EventDateTimeInput.md) + +###### scope + +[`RecurrenceEditScope`](../type-aliases/RecurrenceEditScope.md) + +#### Returns + +`void` + +#### Implementation of + +```ts +CalendarActions.removeRecurringEvent +``` + +*** + +### setEvents() + +```ts +setEvents(events): void; +``` + +Defined in: [calendar/calendar.ts:3819](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L3819) + +Replaces the current event list and invalidates availability caches. + +#### Parameters + +##### events + +`TEvent`[] | `null` + +#### Returns + +`void` + +#### Implementation of + +```ts +CalendarActions.setEvents +``` + +*** + +### setResources() + +```ts +setResources(resources): void; +``` + +Defined in: [calendar/calendar.ts:3807](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L3807) + +Replaces the current resource list and invalidates availability caches. + +#### Parameters + +##### resources + +`TResource`[] | `null` + +#### Returns + +`void` + +#### Implementation of + +```ts +CalendarActions.setResources +``` + +*** + +### undo() + +```ts +undo(): void; +``` + +Defined in: [calendar/calendar.ts:1014](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L1014) + +Reverts the last mutating action (commitAdd, commitUpdate, removeEvent). + +#### Returns + +`void` + +#### Implementation of + +```ts +CalendarActions.undo +``` + +*** + +### validateEventDependencies() + +```ts +validateEventDependencies(event, dependsOn): object; +``` + +Defined in: [calendar/calendar.ts:2061](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L2061) + +Validates if placing an event with a specific start time satisfies all dependency constraints. + +#### Parameters + +##### event + +###### end + +`string` + +###### id? + +`string` + +###### start + +`string` + +###### title + +`string` + +##### dependsOn + +[`EventDependency`](../interfaces/EventDependency.md)[] + +#### Returns + +`object` + +##### error? + +```ts +optional error: ResizeError; +``` + +##### valid + +```ts +valid: boolean; +``` + +#### Implementation of + +```ts +CalendarActions.validateEventDependencies +``` + +*** + +### validateEventPlacement() + +```ts +validateEventPlacement(event): object; +``` + +Defined in: [calendar/calendar.ts:2118](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L2118) + +Validates whether a new event (not yet added to the calendar) can be +placed at the given time slot without violating resource availability. +Use this for standalone validation before manually committing events. + +#### Parameters + +##### event + +###### consumption? + +`number`[] + +###### end + +`string` + +###### id? + +`string` + +###### resources? + +(`string` \| `TResource`)[] + +###### start + +`string` + +###### title + +`string` + +#### Returns + +`object` + +##### blocked + +```ts +blocked: boolean; +``` + +##### message? + +```ts +optional message: string; +``` + +#### Implementation of + +```ts +CalendarActions.validateEventPlacement +``` + +*** + +### validateMove() + +```ts +validateMove( + eventId, + newStart, + newEnd, + newResources?, + newConsumption?): object; +``` + +Defined in: [calendar/calendar.ts:1852](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L1852) + +Checks whether moving `eventId` to `[newStart, newEnd]` — and cascading +all finish-to-start dependents — would violate any resource availability. + +#### Parameters + +##### eventId + +`string` + +##### newStart + +`string` + +##### newEnd + +`string` + +##### newResources? + +(`string` \| `TResource`)[] + +##### newConsumption? + +`number`[] + +#### Returns + +`object` + +##### blocked + +```ts +blocked: boolean; +``` + +##### blockedEventTitle? + +```ts +optional blockedEventTitle: string; +``` + +##### message? + +```ts +optional message: string; +``` + +#### Implementation of + +```ts +CalendarActions.validateMove +``` + +*** + +### validateResize() + +```ts +validateResize(options): ValidateResizeResult; +``` + +Defined in: [calendar/calendar.ts:3296](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L3296) + +#### Parameters + +##### options + +[`ValidateResizeOptions`](../interfaces/ValidateResizeOptions.md) + +#### Returns + +[`ValidateResizeResult`](../interfaces/ValidateResizeResult.md) diff --git a/docs/reference/classes/DateCore.md b/docs/reference/classes/DateCore.md new file mode 100644 index 00000000..9176261f --- /dev/null +++ b/docs/reference/classes/DateCore.md @@ -0,0 +1,326 @@ +--- +id: DateCore +title: DateCore +--- + +# Abstract Class: DateCore + +Defined in: [calendar/date-core.ts:78](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L78) + +## Extended by + +- [`CalendarCore`](CalendarCore.md) + +## Constructors + +### Constructor + +```ts +new DateCore(options): DateCore; +``` + +Defined in: [calendar/date-core.ts:86](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L86) + +#### Parameters + +##### options + +[`DateCoreOptions`](../interfaces/DateCoreOptions.md) + +#### Returns + +`DateCore` + +## Properties + +### formatters + +```ts +formatters: object; +``` + +Defined in: [calendar/date-core.ts:81](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L81) + +#### date + +```ts +date: DateTimeFormat; +``` + +#### dateTime + +```ts +dateTime: DateTimeFormat; +``` + +#### time + +```ts +time: DateTimeFormat; +``` + +*** + +### options + +```ts +options: ParsedDateCoreOptions; +``` + +Defined in: [calendar/date-core.ts:80](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L80) + +*** + +### store + +```ts +store: Store; +``` + +Defined in: [calendar/date-core.ts:79](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L79) + +## Methods + +### canGoNextPeriod() + +```ts +canGoNextPeriod(): boolean; +``` + +Defined in: [calendar/date-core.ts:446](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L446) + +#### Returns + +`boolean` + +*** + +### canGoPreviousPeriod() + +```ts +canGoPreviousPeriod(): boolean; +``` + +Defined in: [calendar/date-core.ts:415](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L415) + +#### Returns + +`boolean` + +*** + +### changeViewMode() + +```ts +changeViewMode(newViewMode): void; +``` + +Defined in: [calendar/date-core.ts:266](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L266) + +#### Parameters + +##### newViewMode + +[`ViewMode`](../interfaces/ViewMode.md) + +#### Returns + +`void` + +*** + +### formatDate() + +```ts +formatDate(date): string; +``` + +Defined in: [calendar/date-core.ts:132](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L132) + +#### Parameters + +##### date + +[`DateInput`](../type-aliases/DateInput.md) + +#### Returns + +`string` + +*** + +### formatDateTime() + +```ts +formatDateTime(date): string; +``` + +Defined in: [calendar/date-core.ts:140](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L140) + +#### Parameters + +##### date + +[`DateInput`](../type-aliases/DateInput.md) + +#### Returns + +`string` + +*** + +### formatTime() + +```ts +formatTime(date): string; +``` + +Defined in: [calendar/date-core.ts:136](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L136) + +#### Parameters + +##### date + +[`DateInput`](../type-aliases/DateInput.md) + +#### Returns + +`string` + +*** + +### getCalendarDays() + +```ts +protected getCalendarDays(): PlainDate[]; +``` + +Defined in: [calendar/date-core.ts:163](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L163) + +#### Returns + +`PlainDate`[] + +*** + +### getDaysNames() + +```ts +getDaysNames(weekday): string[]; +``` + +Defined in: [calendar/date-core.ts:255](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L255) + +#### Parameters + +##### weekday + +`"long"` | `"short"` + +#### Returns + +`string`[] + +*** + +### getFirstDayOfMonth() + +```ts +protected getFirstDayOfMonth(): PlainDate; +``` + +Defined in: [calendar/date-core.ts:144](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L144) + +#### Returns + +`PlainDate` + +*** + +### getFirstDayOfWeek() + +```ts +protected getFirstDayOfWeek(): PlainDate; +``` + +Defined in: [calendar/date-core.ts:152](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L152) + +#### Returns + +`PlainDate` + +*** + +### getWeekStartsOn() + +```ts +getWeekStartsOn(): number; +``` + +Defined in: [calendar/date-core.ts:159](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L159) + +#### Returns + +`number` + +*** + +### goToCurrentPeriod() + +```ts +goToCurrentPeriod(): void; +``` + +Defined in: [calendar/date-core.ts:376](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L376) + +#### Returns + +`void` + +*** + +### goToNextPeriod() + +```ts +goToNextPeriod(): void; +``` + +Defined in: [calendar/date-core.ts:328](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L328) + +#### Returns + +`void` + +*** + +### goToPreviousPeriod() + +```ts +goToPreviousPeriod(): void; +``` + +Defined in: [calendar/date-core.ts:280](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L280) + +#### Returns + +`void` + +*** + +### goToSpecificPeriod() + +```ts +goToSpecificPeriod(date): void; +``` + +Defined in: [calendar/date-core.ts:394](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L394) + +#### Parameters + +##### date + +[`DateInput`](../type-aliases/DateInput.md) + +#### Returns + +`void` diff --git a/docs/reference/classes/ResizeController.md b/docs/reference/classes/ResizeController.md new file mode 100644 index 00000000..18391278 --- /dev/null +++ b/docs/reference/classes/ResizeController.md @@ -0,0 +1,280 @@ +--- +id: ResizeController +title: ResizeController +--- + +# Class: ResizeController\ + +Defined in: [calendar/resizeController.ts:95](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L95) + +Framework-agnostic controller that owns: + - resize state machine (preview, blocked, lastValid) + - rAF coalescing for `mousemove` + - day-column registry + cached rects + - last-processed dedupe + last-emitted-error dedupe + - delegation to `CalendarCore.validateResize` / `commitUpdate` + +UI bindings (React, Solid, etc.) only need to: + 1. Subscribe to state changes and read `getSnapshot()`. + 2. Forward DOM `mousedown` to `start()`, then attach `handleMouseMove` / + `handleMouseUp` to `document` (the controller exposes these as bound + methods so the same reference can be used for `addEventListener` / + `removeEventListener`). + 3. Call `registerDayColumn(date, element)` from a ref callback. + +## Type Parameters + +### TResource + +`TResource` *extends* [`Resource`](../interfaces/Resource.md) + +### TEvent + +`TEvent` *extends* [`Event`](../interfaces/Event.md)\<`TResource`\> + +## Constructors + +### Constructor + +```ts +new ResizeController(calendarCore, options): ResizeController; +``` + +Defined in: [calendar/resizeController.ts:134](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L134) + +#### Parameters + +##### calendarCore + +[`CalendarCore`](CalendarCore.md)\<`TResource`, `TEvent`\> + +##### options + +[`ResizeControllerOptions`](../interfaces/ResizeControllerOptions.md) = `{}` + +#### Returns + +`ResizeController`\<`TResource`, `TEvent`\> + +## Methods + +### cancel() + +```ts +cancel(): void; +``` + +Defined in: [calendar/resizeController.ts:232](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L232) + +#### Returns + +`void` + +*** + +### destroy() + +```ts +destroy(): void; +``` + +Defined in: [calendar/resizeController.ts:242](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L242) + +#### Returns + +`void` + +*** + +### getDayFromElement() + +```ts +getDayFromElement(element): string | null; +``` + +Defined in: [calendar/resizeController.ts:185](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L185) + +#### Parameters + +##### element + +`HTMLElement` + +#### Returns + +`string` \| `null` + +*** + +### getDayFromPoint() + +```ts +getDayFromPoint(clientX): string | null; +``` + +Defined in: [calendar/resizeController.ts:170](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L170) + +#### Parameters + +##### clientX + +`number` + +#### Returns + +`string` \| `null` + +*** + +### getOptions() + +```ts +getOptions(): ResizeControllerOptions; +``` + +Defined in: [calendar/resizeController.ts:158](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L158) + +#### Returns + +[`ResizeControllerOptions`](../interfaces/ResizeControllerOptions.md) + +*** + +### getSnapshot() + +```ts +getSnapshot(): ResizeState; +``` + +Defined in: [calendar/resizeController.ts:152](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L152) + +#### Returns + +[`ResizeState`](../interfaces/ResizeState.md) + +*** + +### handleMouseMove() + +```ts +handleMouseMove(e): void; +``` + +Defined in: [calendar/resizeController.ts:254](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L254) + +#### Parameters + +##### e + +`MouseEvent` + +#### Returns + +`void` + +*** + +### handleMouseUp() + +```ts +handleMouseUp(): void; +``` + +Defined in: [calendar/resizeController.ts:269](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L269) + +Mouse-up handler. Auto-attached by `start()`; commits if the preview +differs from the original event range, then detaches DOM listeners. + +#### Returns + +`void` + +*** + +### registerDayColumn() + +```ts +registerDayColumn(date, element): void; +``` + +Defined in: [calendar/resizeController.ts:162](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L162) + +#### Parameters + +##### date + +`string` + +##### element + +`HTMLElement` | `null` + +#### Returns + +`void` + +*** + +### setOptions() + +```ts +setOptions(options): void; +``` + +Defined in: [calendar/resizeController.ts:154](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L154) + +#### Parameters + +##### options + +[`ResizeControllerOptions`](../interfaces/ResizeControllerOptions.md) + +#### Returns + +`void` + +*** + +### start() + +```ts +start(args): boolean; +``` + +Defined in: [calendar/resizeController.ts:192](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L192) + +#### Parameters + +##### args + +[`ResizeStartArgs`](../interfaces/ResizeStartArgs.md) + +#### Returns + +`boolean` + +*** + +### subscribe() + +```ts +subscribe(listener): () => void; +``` + +Defined in: [calendar/resizeController.ts:145](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L145) + +#### Parameters + +##### listener + +[`ResizeListener`](../type-aliases/ResizeListener.md) + +#### Returns + +```ts +(): void; +``` + +##### Returns + +`void` diff --git a/docs/reference/functions/add.md b/docs/reference/functions/add.md new file mode 100644 index 00000000..b3b99a48 --- /dev/null +++ b/docs/reference/functions/add.md @@ -0,0 +1,89 @@ +--- +id: add +title: add +--- + +# Function: add() + +```ts +function add(input, options): object; +``` + +Defined in: [date/add/add.ts:13](https://github.com/TanStack/time/blob/main/packages/time/src/date/add/add.ts#L13) + +add +Adds a duration to a date/time instance + +## Parameters + +### input + +[`DateInput`](../type-aliases/DateInput.md) + +### options + +[`AddOptions`](../interfaces/AddOptions.md) + +## Returns + +`object` + +### asDate() + +```ts +asDate: () => Date; +``` + +#### Returns + +`Date` + +### asEpoch() + +```ts +asEpoch: () => number; +``` + +#### Returns + +`number` + +### asZonedDateTime() + +```ts +asZonedDateTime: () => ZonedDateTime; +``` + +#### Returns + +`ZonedDateTime` + +### calendar + +```ts +calendar: string = options.calendar; +``` + +### options + +```ts +options: ResolvedDateOperationOptions; +``` + +### returnFormat + +```ts +returnFormat: ReturnFormat; +``` + +### timeZone + +```ts +timeZone: string = options.timeZone; +``` + +### value + +```ts +value: string; +``` diff --git a/docs/reference/functions/calculateDeltaMinutesFromPixels.md b/docs/reference/functions/calculateDeltaMinutesFromPixels.md new file mode 100644 index 00000000..2059ee2b --- /dev/null +++ b/docs/reference/functions/calculateDeltaMinutesFromPixels.md @@ -0,0 +1,33 @@ +--- +id: calculateDeltaMinutesFromPixels +title: calculateDeltaMinutesFromPixels +--- + +# Function: calculateDeltaMinutesFromPixels() + +```ts +function calculateDeltaMinutesFromPixels( + deltaPixels, + containerHeight, + minutesInDay): number; +``` + +Defined in: [calendar/getResizeProps.ts:167](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L167) + +## Parameters + +### deltaPixels + +`number` + +### containerHeight + +`number` + +### minutesInDay + +`number` = `...` + +## Returns + +`number` diff --git a/docs/reference/functions/calculateDeltaMinutesFromPixelsHorizontal.md b/docs/reference/functions/calculateDeltaMinutesFromPixelsHorizontal.md new file mode 100644 index 00000000..ba56199b --- /dev/null +++ b/docs/reference/functions/calculateDeltaMinutesFromPixelsHorizontal.md @@ -0,0 +1,33 @@ +--- +id: calculateDeltaMinutesFromPixelsHorizontal +title: calculateDeltaMinutesFromPixelsHorizontal +--- + +# Function: calculateDeltaMinutesFromPixelsHorizontal() + +```ts +function calculateDeltaMinutesFromPixelsHorizontal( + deltaPixels, + containerWidth, + totalMinutesInView): number; +``` + +Defined in: [calendar/getResizeProps.ts:175](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L175) + +## Parameters + +### deltaPixels + +`number` + +### containerWidth + +`number` + +### totalMinutesInView + +`number` + +## Returns + +`number` diff --git a/docs/reference/functions/calculateGhostPreviewStyle.md b/docs/reference/functions/calculateGhostPreviewStyle.md new file mode 100644 index 00000000..bf815c36 --- /dev/null +++ b/docs/reference/functions/calculateGhostPreviewStyle.md @@ -0,0 +1,24 @@ +--- +id: calculateGhostPreviewStyle +title: calculateGhostPreviewStyle +--- + +# Function: calculateGhostPreviewStyle() + +```ts +function calculateGhostPreviewStyle(options): PositionStyle | null; +``` + +Defined in: [calendar/getResizeProps.ts:381](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L381) + +Calculates the ghost preview style for a day that doesn't have an existing segment + +## Parameters + +### options + +[`GhostPreviewOptions`](../interfaces/GhostPreviewOptions.md) + +## Returns + +[`PositionStyle`](../interfaces/PositionStyle.md) \| `null` diff --git a/docs/reference/functions/calculateResizedEvent.md b/docs/reference/functions/calculateResizedEvent.md new file mode 100644 index 00000000..174368fc --- /dev/null +++ b/docs/reference/functions/calculateResizedEvent.md @@ -0,0 +1,22 @@ +--- +id: calculateResizedEvent +title: calculateResizedEvent +--- + +# Function: calculateResizedEvent() + +```ts +function calculateResizedEvent(options): ResizedEventResult; +``` + +Defined in: [calendar/getResizeProps.ts:58](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L58) + +## Parameters + +### options + +`CalculateResizedEventOptions` + +## Returns + +`ResizedEventResult` diff --git a/docs/reference/functions/calculateSegmentResizePreview.md b/docs/reference/functions/calculateSegmentResizePreview.md new file mode 100644 index 00000000..b3649af6 --- /dev/null +++ b/docs/reference/functions/calculateSegmentResizePreview.md @@ -0,0 +1,24 @@ +--- +id: calculateSegmentResizePreview +title: calculateSegmentResizePreview +--- + +# Function: calculateSegmentResizePreview() + +```ts +function calculateSegmentResizePreview(options): SegmentResizePreview; +``` + +Defined in: [calendar/getResizeProps.ts:299](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L299) + +Calculates the resize preview state for a segment on a specific day + +## Parameters + +### options + +[`ResizePreviewOptions`](../interfaces/ResizePreviewOptions.md) + +## Returns + +[`SegmentResizePreview`](../interfaces/SegmentResizePreview.md) diff --git a/docs/reference/functions/calculateTimelineResizePreview.md b/docs/reference/functions/calculateTimelineResizePreview.md new file mode 100644 index 00000000..e611a1f2 --- /dev/null +++ b/docs/reference/functions/calculateTimelineResizePreview.md @@ -0,0 +1,24 @@ +--- +id: calculateTimelineResizePreview +title: calculateTimelineResizePreview +--- + +# Function: calculateTimelineResizePreview() + +```ts +function calculateTimelineResizePreview(options): TimelineResizePreviewStyle; +``` + +Defined in: [calendar/getResizeProps.ts:452](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L452) + +Calculates left/width percentages for timeline resize preview + +## Parameters + +### options + +[`TimelineResizePreviewOptions`](../interfaces/TimelineResizePreviewOptions.md) + +## Returns + +[`TimelineResizePreviewStyle`](../interfaces/TimelineResizePreviewStyle.md) diff --git a/docs/reference/functions/ceil.md b/docs/reference/functions/ceil.md new file mode 100644 index 00000000..8705374f --- /dev/null +++ b/docs/reference/functions/ceil.md @@ -0,0 +1,86 @@ +--- +id: ceil +title: ceil +--- + +# Function: ceil() + +```ts +function ceil(input, options): object; +``` + +Defined in: [date/ceil/ceil.ts:18](https://github.com/TanStack/time/blob/main/packages/time/src/date/ceil/ceil.ts#L18) + +## Parameters + +### input + +[`DateInput`](../type-aliases/DateInput.md) + +### options + +[`CeilOptions`](../interfaces/CeilOptions.md) + +## Returns + +`object` + +### asDate() + +```ts +asDate: () => Date; +``` + +#### Returns + +`Date` + +### asEpoch() + +```ts +asEpoch: () => number; +``` + +#### Returns + +`number` + +### asZonedDateTime() + +```ts +asZonedDateTime: () => ZonedDateTime; +``` + +#### Returns + +`ZonedDateTime` + +### calendar + +```ts +calendar: string = options.calendar; +``` + +### options + +```ts +options: ResolvedDateOperationOptions; +``` + +### returnFormat + +```ts +returnFormat: ReturnFormat; +``` + +### timeZone + +```ts +timeZone: string = options.timeZone; +``` + +### value + +```ts +value: string; +``` diff --git a/docs/reference/functions/clamp.md b/docs/reference/functions/clamp.md new file mode 100644 index 00000000..e48a12a0 --- /dev/null +++ b/docs/reference/functions/clamp.md @@ -0,0 +1,86 @@ +--- +id: clamp +title: clamp +--- + +# Function: clamp() + +```ts +function clamp(input, options): object; +``` + +Defined in: [date/clamp/clamp.ts:10](https://github.com/TanStack/time/blob/main/packages/time/src/date/clamp/clamp.ts#L10) + +## Parameters + +### input + +[`DateInput`](../type-aliases/DateInput.md) + +### options + +[`ClampOptions`](../interfaces/ClampOptions.md) + +## Returns + +`object` + +### asDate() + +```ts +asDate: () => Date; +``` + +#### Returns + +`Date` + +### asEpoch() + +```ts +asEpoch: () => number; +``` + +#### Returns + +`number` + +### asZonedDateTime() + +```ts +asZonedDateTime: () => ZonedDateTime; +``` + +#### Returns + +`ZonedDateTime` + +### calendar + +```ts +calendar: string = options.calendar; +``` + +### options + +```ts +options: ResolvedDateOperationOptions; +``` + +### returnFormat + +```ts +returnFormat: ReturnFormat; +``` + +### timeZone + +```ts +timeZone: string = options.timeZone; +``` + +### value + +```ts +value: string; +``` diff --git a/docs/reference/functions/count.md b/docs/reference/functions/count.md new file mode 100644 index 00000000..837d1f21 --- /dev/null +++ b/docs/reference/functions/count.md @@ -0,0 +1,33 @@ +--- +id: count +title: count +--- + +# Function: count() + +```ts +function count( + start, + end, + options): number; +``` + +Defined in: [date/count/count.ts:19](https://github.com/TanStack/time/blob/main/packages/time/src/date/count/count.ts#L19) + +## Parameters + +### start + +[`DateInput`](../type-aliases/DateInput.md) + +### end + +[`DateInput`](../type-aliases/DateInput.md) + +### options + +[`CountOptions`](../interfaces/CountOptions.md) + +## Returns + +`number` diff --git a/docs/reference/functions/endOf.md b/docs/reference/functions/endOf.md new file mode 100644 index 00000000..6f8e8077 --- /dev/null +++ b/docs/reference/functions/endOf.md @@ -0,0 +1,89 @@ +--- +id: endOf +title: endOf +--- + +# Function: endOf() + +```ts +function endOf(input, options): object; +``` + +Defined in: [date/endOf/endOf.ts:23](https://github.com/TanStack/time/blob/main/packages/time/src/date/endOf/endOf.ts#L23) + +endOf +Returns the end of a given unit for a date/time instance + +## Parameters + +### input + +[`DateInput`](../type-aliases/DateInput.md) + +### options + +[`EndOfOptions`](../interfaces/EndOfOptions.md) + +## Returns + +`object` + +### asDate() + +```ts +asDate: () => Date; +``` + +#### Returns + +`Date` + +### asEpoch() + +```ts +asEpoch: () => number; +``` + +#### Returns + +`number` + +### asZonedDateTime() + +```ts +asZonedDateTime: () => ZonedDateTime; +``` + +#### Returns + +`ZonedDateTime` + +### calendar + +```ts +calendar: string = options.calendar; +``` + +### options + +```ts +options: ResolvedDateOperationOptions; +``` + +### returnFormat + +```ts +returnFormat: ReturnFormat; +``` + +### timeZone + +```ts +timeZone: string = options.timeZone; +``` + +### value + +```ts +value: string; +``` diff --git a/docs/reference/functions/equals.md b/docs/reference/functions/equals.md new file mode 100644 index 00000000..7e9724aa --- /dev/null +++ b/docs/reference/functions/equals.md @@ -0,0 +1,41 @@ +--- +id: equals +title: equals +--- + +# Function: equals() + +```ts +function equals( + date1, + date2, + unit, + options?): boolean; +``` + +Defined in: [date/equals/equals.ts:22](https://github.com/TanStack/time/blob/main/packages/time/src/date/equals/equals.ts#L22) + +equals +Returns true if two date/time instances are equal at the specified unit level + +## Parameters + +### date1 + +[`DateInput`](../type-aliases/DateInput.md) + +### date2 + +[`DateInput`](../type-aliases/DateInput.md) + +### unit + +[`EqualsUnit`](../type-aliases/EqualsUnit.md) + +### options? + +[`EqualsOptions`](../interfaces/EqualsOptions.md) + +## Returns + +`boolean` diff --git a/docs/reference/functions/format.md b/docs/reference/functions/format.md new file mode 100644 index 00000000..1c20d4a2 --- /dev/null +++ b/docs/reference/functions/format.md @@ -0,0 +1,33 @@ +--- +id: format +title: format +--- + +# Function: format() + +```ts +function format(date, formatOptions?): string; +``` + +Defined in: [date/format/format.ts:32](https://github.com/TanStack/time/blob/main/packages/time/src/date/format/format.ts#L32) + +format +Formats a date/time instance using Intl.DateTimeFormat + +## Parameters + +### date + +[`DateInput`](../type-aliases/DateInput.md) + +The date to format + +### formatOptions? + +[`FormatDateOptions`](../interfaces/FormatDateOptions.md) + +Formatting options including type, locale, and Intl.DateTimeFormat options + +## Returns + +`string` diff --git a/docs/reference/functions/formatEventTimeRange.md b/docs/reference/functions/formatEventTimeRange.md new file mode 100644 index 00000000..2a6d8f36 --- /dev/null +++ b/docs/reference/functions/formatEventTimeRange.md @@ -0,0 +1,37 @@ +--- +id: formatEventTimeRange +title: formatEventTimeRange +--- + +# Function: formatEventTimeRange() + +```ts +function formatEventTimeRange( + start, + end, + options): FormattedEventTime; +``` + +Defined in: [calendar/getResizeProps.ts:562](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L562) + +Formats an event's time range for display +For multi-day events: includes date and time +For single-day events: includes only time (unless alwaysShowDate is true) + +## Parameters + +### start + +`string` + +### end + +`string` + +### options + +[`FormatEventTimeOptions`](../interfaces/FormatEventTimeOptions.md) = `{}` + +## Returns + +[`FormattedEventTime`](../interfaces/FormattedEventTime.md) diff --git a/docs/reference/functions/fromUnixTime.md b/docs/reference/functions/fromUnixTime.md new file mode 100644 index 00000000..1c2b14e1 --- /dev/null +++ b/docs/reference/functions/fromUnixTime.md @@ -0,0 +1,86 @@ +--- +id: fromUnixTime +title: fromUnixTime +--- + +# Function: fromUnixTime() + +```ts +function fromUnixTime(timestamp, options?): object; +``` + +Defined in: [date/fromUnixTime/fromUnixTime.ts:8](https://github.com/TanStack/time/blob/main/packages/time/src/date/fromUnixTime/fromUnixTime.ts#L8) + +## Parameters + +### timestamp + +`number` + +### options? + +[`FromUnixTimeOptions`](../interfaces/FromUnixTimeOptions.md) + +## Returns + +`object` + +### asDate() + +```ts +asDate: () => Date; +``` + +#### Returns + +`Date` + +### asEpoch() + +```ts +asEpoch: () => number; +``` + +#### Returns + +`number` + +### asZonedDateTime() + +```ts +asZonedDateTime: () => ZonedDateTime; +``` + +#### Returns + +`ZonedDateTime` + +### calendar + +```ts +calendar: string = options.calendar; +``` + +### options + +```ts +options: ResolvedDateOperationOptions; +``` + +### returnFormat + +```ts +returnFormat: ReturnFormat; +``` + +### timeZone + +```ts +timeZone: string = options.timeZone; +``` + +### value + +```ts +value: string; +``` diff --git a/docs/reference/functions/generateDateRange.md b/docs/reference/functions/generateDateRange.md new file mode 100644 index 00000000..8780d59c --- /dev/null +++ b/docs/reference/functions/generateDateRange.md @@ -0,0 +1,26 @@ +--- +id: generateDateRange +title: generateDateRange +--- + +# Function: generateDateRange() + +```ts +function generateDateRange(start, end): PlainDate[]; +``` + +Defined in: [calendar/generateDateRange.ts:3](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/generateDateRange.ts#L3) + +## Parameters + +### start + +`string` + +### end + +`string` + +## Returns + +`PlainDate`[] diff --git a/docs/reference/functions/getDayOfYear.md b/docs/reference/functions/getDayOfYear.md new file mode 100644 index 00000000..8c25cd72 --- /dev/null +++ b/docs/reference/functions/getDayOfYear.md @@ -0,0 +1,26 @@ +--- +id: getDayOfYear +title: getDayOfYear +--- + +# Function: getDayOfYear() + +```ts +function getDayOfYear(date, options?): number; +``` + +Defined in: [date/getDayOfYear/getDayOfYear.ts:7](https://github.com/TanStack/time/blob/main/packages/time/src/date/getDayOfYear/getDayOfYear.ts#L7) + +## Parameters + +### date + +[`DateInput`](../type-aliases/DateInput.md) + +### options? + +[`GetDayOfYearOptions`](../interfaces/GetDayOfYearOptions.md) + +## Returns + +`number` diff --git a/docs/reference/functions/getEventDisplayTimeRange.md b/docs/reference/functions/getEventDisplayTimeRange.md new file mode 100644 index 00000000..883a7db8 --- /dev/null +++ b/docs/reference/functions/getEventDisplayTimeRange.md @@ -0,0 +1,42 @@ +--- +id: getEventDisplayTimeRange +title: getEventDisplayTimeRange +--- + +# Function: getEventDisplayTimeRange() + +```ts +function getEventDisplayTimeRange(options): EventTimeRange; +``` + +Defined in: [calendar/getResizeProps.ts:513](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L513) + +Gets the time range to display for an event, considering resize state + +## Parameters + +### options + +#### isBeingResized? + +`boolean` + +#### originalEnd + +`string` + +#### originalStart + +`string` + +#### previewEnd? + +`string` + +#### previewStart? + +`string` + +## Returns + +[`EventTimeRange`](../interfaces/EventTimeRange.md) diff --git a/docs/reference/functions/getEventProps.md b/docs/reference/functions/getEventProps.md new file mode 100644 index 00000000..9232db4c --- /dev/null +++ b/docs/reference/functions/getEventProps.md @@ -0,0 +1,73 @@ +--- +id: getEventProps +title: getEventProps +--- + +# Function: getEventProps() + +```ts +function getEventProps( + eventMap, + event, + state, + options): + | { + end: string; + isSplitEvent: boolean; + overlappingEvents: Event[]; + start: string; +} + | { + end: string; + isSplitEvent: boolean; + overlappingEvents: Event[]; + start: string; + style: { + height: string; + left: string; + top: string; + width: string; + }; +}; +``` + +Defined in: [calendar/getEventProps.ts:59](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getEventProps.ts#L59) + +## Parameters + +### eventMap + +`Map`\<`string`, [`Event`](../interfaces/Event.md)\<[`Resource`](../interfaces/Resource.md)\>[]\> + +### event + +[`Event`](../interfaces/Event.md) + +### state + +[`CalendarStore`](../interfaces/CalendarStore.md) + +### options + +`GetEventPropsOptions` + +## Returns + + \| \{ + `end`: `string`; + `isSplitEvent`: `boolean`; + `overlappingEvents`: [`Event`](../interfaces/Event.md)\<[`Resource`](../interfaces/Resource.md)\>[]; + `start`: `string`; +\} + \| \{ + `end`: `string`; + `isSplitEvent`: `boolean`; + `overlappingEvents`: [`Event`](../interfaces/Event.md)\<[`Resource`](../interfaces/Resource.md)\>[]; + `start`: `string`; + `style`: \{ + `height`: `string`; + `left`: `string`; + `top`: `string`; + `width`: `string`; + \}; +\} diff --git a/docs/reference/functions/getResizeHandleStyle.md b/docs/reference/functions/getResizeHandleStyle.md new file mode 100644 index 00000000..30db97a0 --- /dev/null +++ b/docs/reference/functions/getResizeHandleStyle.md @@ -0,0 +1,22 @@ +--- +id: getResizeHandleStyle +title: getResizeHandleStyle +--- + +# Function: getResizeHandleStyle() + +```ts +function getResizeHandleStyle(edge): ResizeHandleStyle; +``` + +Defined in: [calendar/getResizeProps.ts:194](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L194) + +## Parameters + +### edge + +[`ResizeEdge`](../type-aliases/ResizeEdge.md) + +## Returns + +[`ResizeHandleStyle`](../interfaces/ResizeHandleStyle.md) diff --git a/docs/reference/functions/getSegmentInfo.md b/docs/reference/functions/getSegmentInfo.md new file mode 100644 index 00000000..6b6bb801 --- /dev/null +++ b/docs/reference/functions/getSegmentInfo.md @@ -0,0 +1,36 @@ +--- +id: getSegmentInfo +title: getSegmentInfo +--- + +# Function: getSegmentInfo() + +```ts +function getSegmentInfo(event): SegmentInfo; +``` + +Defined in: [calendar/getResizeProps.ts:230](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L230) + +## Parameters + +### event + +#### _originalEnd? + +`string` + +#### _originalStart? + +`string` + +#### end + +`string` + +#### start + +`string` + +## Returns + +[`SegmentInfo`](../interfaces/SegmentInfo.md) diff --git a/docs/reference/functions/getTimeClient.md b/docs/reference/functions/getTimeClient.md new file mode 100644 index 00000000..44148d53 --- /dev/null +++ b/docs/reference/functions/getTimeClient.md @@ -0,0 +1,18 @@ +--- +id: getTimeClient +title: getTimeClient +--- + +# Function: getTimeClient() + +```ts +function getTimeClient(): TimeClient; +``` + +Defined in: [client/TimeClient.ts:87](https://github.com/TanStack/time/blob/main/packages/time/src/client/TimeClient.ts#L87) + +Get the global TimeClient instance + +## Returns + +`TimeClient` diff --git a/docs/reference/functions/getTimeSlots.md b/docs/reference/functions/getTimeSlots.md new file mode 100644 index 00000000..f88c1fc4 --- /dev/null +++ b/docs/reference/functions/getTimeSlots.md @@ -0,0 +1,35 @@ +--- +id: getTimeSlots +title: getTimeSlots +--- + +# Function: getTimeSlots() + +```ts +function getTimeSlots(locale, options?): TimeSlot[]; +``` + +Defined in: [calendar/getTimeSlots.ts:19](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getTimeSlots.ts#L19) + +Generates time slots for calendar day views. +Returns an array of time slots with labels formatted according to the locale. + +## Parameters + +### locale + +`string` + +The locale to use for formatting time labels (BCP 47 format) + +### options? + +`TimeSlotOptions` + +Configuration options for time slots + +## Returns + +[`TimeSlot`](../interfaces/TimeSlot.md)[] + +Array of time slots with hour, minute, and formatted label diff --git a/docs/reference/functions/getUnixTime.md b/docs/reference/functions/getUnixTime.md new file mode 100644 index 00000000..f51520a1 --- /dev/null +++ b/docs/reference/functions/getUnixTime.md @@ -0,0 +1,26 @@ +--- +id: getUnixTime +title: getUnixTime +--- + +# Function: getUnixTime() + +```ts +function getUnixTime(date, options?): number; +``` + +Defined in: [date/getUnixTime/getUnixTime.ts:7](https://github.com/TanStack/time/blob/main/packages/time/src/date/getUnixTime/getUnixTime.ts#L7) + +## Parameters + +### date + +[`DateInput`](../type-aliases/DateInput.md) + +### options? + +[`GetUnixTimeOptions`](../interfaces/GetUnixTimeOptions.md) + +## Returns + +`number` diff --git a/docs/reference/functions/getWeek.md b/docs/reference/functions/getWeek.md new file mode 100644 index 00000000..f4f8d7b4 --- /dev/null +++ b/docs/reference/functions/getWeek.md @@ -0,0 +1,26 @@ +--- +id: getWeek +title: getWeek +--- + +# Function: getWeek() + +```ts +function getWeek(date, options?): number; +``` + +Defined in: [date/getWeek/getWeek.ts:7](https://github.com/TanStack/time/blob/main/packages/time/src/date/getWeek/getWeek.ts#L7) + +## Parameters + +### date + +[`DateInput`](../type-aliases/DateInput.md) + +### options? + +[`GetWeekOptions`](../interfaces/GetWeekOptions.md) + +## Returns + +`number` diff --git a/docs/reference/functions/groupDaysBy.md b/docs/reference/functions/groupDaysBy.md new file mode 100644 index 00000000..85f7a639 --- /dev/null +++ b/docs/reference/functions/groupDaysBy.md @@ -0,0 +1,32 @@ +--- +id: groupDaysBy +title: groupDaysBy +--- + +# Function: groupDaysBy() + +```ts +function groupDaysBy(__namedParameters): (Day | null)[][]; +``` + +Defined in: [calendar/groupDaysBy.ts:37](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/groupDaysBy.ts#L37) + +## Type Parameters + +### TResource + +`TResource` *extends* [`Resource`](../interfaces/Resource.md) + +### TEvent + +`TEvent` *extends* [`Event`](../interfaces/Event.md)\<`TResource`\> = [`Event`](../interfaces/Event.md)\<`TResource`\> + +## Parameters + +### \_\_namedParameters + +[`GroupDaysByProps`](../type-aliases/GroupDaysByProps.md)\<`TResource`, `TEvent`\> + +## Returns + +([`Day`](../type-aliases/Day.md)\<`TResource`, `TEvent`\> \| `null`)[][] diff --git a/docs/reference/functions/intersects.md b/docs/reference/functions/intersects.md new file mode 100644 index 00000000..bdec851b --- /dev/null +++ b/docs/reference/functions/intersects.md @@ -0,0 +1,33 @@ +--- +id: intersects +title: intersects +--- + +# Function: intersects() + +```ts +function intersects(date, options): boolean; +``` + +Defined in: [date/intersects/intersects.ts:16](https://github.com/TanStack/time/blob/main/packages/time/src/date/intersects/intersects.ts#L16) + +intersects +Returns true if the date/time instance intersects with the range (i.e., is within or equal to the range boundaries) + +## Parameters + +### date + +[`DateInput`](../type-aliases/DateInput.md) + +The date to check + +### options + +[`IntersectsOptions`](../interfaces/IntersectsOptions.md) + +Options including range, timeZone and calendar + +## Returns + +`boolean` diff --git a/docs/reference/functions/isAfter.md b/docs/reference/functions/isAfter.md new file mode 100644 index 00000000..c1c06abe --- /dev/null +++ b/docs/reference/functions/isAfter.md @@ -0,0 +1,36 @@ +--- +id: isAfter +title: isAfter +--- + +# Function: isAfter() + +```ts +function isAfter( + date1, + date2, + options?): boolean; +``` + +Defined in: [date/isAfter/isAfter.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/isAfter/isAfter.ts#L12) + +isAfter +Returns true if the first date/time instance is after the second date/time instance + +## Parameters + +### date1 + +[`DateInput`](../type-aliases/DateInput.md) + +### date2 + +[`DateInput`](../type-aliases/DateInput.md) + +### options? + +[`IsAfterOptions`](../interfaces/IsAfterOptions.md) + +## Returns + +`boolean` diff --git a/docs/reference/functions/isBefore.md b/docs/reference/functions/isBefore.md new file mode 100644 index 00000000..796f97f1 --- /dev/null +++ b/docs/reference/functions/isBefore.md @@ -0,0 +1,36 @@ +--- +id: isBefore +title: isBefore +--- + +# Function: isBefore() + +```ts +function isBefore( + date1, + date2, + options?): boolean; +``` + +Defined in: [date/isBefore/isBefore.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/isBefore/isBefore.ts#L12) + +isBefore +Returns true if the first date/time instance is before the second date/time instance + +## Parameters + +### date1 + +[`DateInput`](../type-aliases/DateInput.md) + +### date2 + +[`DateInput`](../type-aliases/DateInput.md) + +### options? + +[`IsBeforeOptions`](../interfaces/IsBeforeOptions.md) + +## Returns + +`boolean` diff --git a/docs/reference/functions/isBetween.md b/docs/reference/functions/isBetween.md new file mode 100644 index 00000000..880bfb4a --- /dev/null +++ b/docs/reference/functions/isBetween.md @@ -0,0 +1,33 @@ +--- +id: isBetween +title: isBetween +--- + +# Function: isBetween() + +```ts +function isBetween(date, options): boolean; +``` + +Defined in: [date/isBetween/isBetween.ts:18](https://github.com/TanStack/time/blob/main/packages/time/src/date/isBetween/isBetween.ts#L18) + +isBetween +Returns true if the date/time instance is between the start and end of the range + +## Parameters + +### date + +[`DateInput`](../type-aliases/DateInput.md) + +The date to check + +### options + +[`IsBetweenOptions`](../interfaces/IsBetweenOptions.md) + +Options including timeZone, calendar, and inclusivity + +## Returns + +`boolean` diff --git a/docs/reference/functions/isFuture.md b/docs/reference/functions/isFuture.md new file mode 100644 index 00000000..b981355c --- /dev/null +++ b/docs/reference/functions/isFuture.md @@ -0,0 +1,26 @@ +--- +id: isFuture +title: isFuture +--- + +# Function: isFuture() + +```ts +function isFuture(date, options?): boolean; +``` + +Defined in: [date/isFuture/isFuture.ts:8](https://github.com/TanStack/time/blob/main/packages/time/src/date/isFuture/isFuture.ts#L8) + +## Parameters + +### date + +[`DateInput`](../type-aliases/DateInput.md) + +### options? + +[`IsFutureOptions`](../interfaces/IsFutureOptions.md) + +## Returns + +`boolean` diff --git a/docs/reference/functions/isLeapYear.md b/docs/reference/functions/isLeapYear.md new file mode 100644 index 00000000..0665af2b --- /dev/null +++ b/docs/reference/functions/isLeapYear.md @@ -0,0 +1,29 @@ +--- +id: isLeapYear +title: isLeapYear +--- + +# Function: isLeapYear() + +```ts +function isLeapYear(date, options?): boolean; +``` + +Defined in: [date/isLeapYear/isLeapYear.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/isLeapYear/isLeapYear.ts#L11) + +isLeapYear +Returns true if the year of the given date is a leap year + +## Parameters + +### date + +[`DateInput`](../type-aliases/DateInput.md) + +### options? + +[`IsLeapYearOptions`](../interfaces/IsLeapYearOptions.md) + +## Returns + +`boolean` diff --git a/docs/reference/functions/isMultiDayEvent.md b/docs/reference/functions/isMultiDayEvent.md new file mode 100644 index 00000000..65524615 --- /dev/null +++ b/docs/reference/functions/isMultiDayEvent.md @@ -0,0 +1,28 @@ +--- +id: isMultiDayEvent +title: isMultiDayEvent +--- + +# Function: isMultiDayEvent() + +```ts +function isMultiDayEvent(start, end): boolean; +``` + +Defined in: [calendar/getResizeProps.ts:498](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L498) + +Checks if an event spans multiple days + +## Parameters + +### start + +`string` + +### end + +`string` + +## Returns + +`boolean` diff --git a/docs/reference/functions/isPast.md b/docs/reference/functions/isPast.md new file mode 100644 index 00000000..9451235b --- /dev/null +++ b/docs/reference/functions/isPast.md @@ -0,0 +1,26 @@ +--- +id: isPast +title: isPast +--- + +# Function: isPast() + +```ts +function isPast(date, options?): boolean; +``` + +Defined in: [date/isPast/isPast.ts:8](https://github.com/TanStack/time/blob/main/packages/time/src/date/isPast/isPast.ts#L8) + +## Parameters + +### date + +[`DateInput`](../type-aliases/DateInput.md) + +### options? + +[`IsPastOptions`](../interfaces/IsPastOptions.md) + +## Returns + +`boolean` diff --git a/docs/reference/functions/isSameOrAfter.md b/docs/reference/functions/isSameOrAfter.md new file mode 100644 index 00000000..1ff85269 --- /dev/null +++ b/docs/reference/functions/isSameOrAfter.md @@ -0,0 +1,36 @@ +--- +id: isSameOrAfter +title: isSameOrAfter +--- + +# Function: isSameOrAfter() + +```ts +function isSameOrAfter( + date1, + date2, + options): boolean; +``` + +Defined in: [date/isSameOrAfter/isSameOrAfter.ts:25](https://github.com/TanStack/time/blob/main/packages/time/src/date/isSameOrAfter/isSameOrAfter.ts#L25) + +isSameOrAfter +Returns true if the first date/time instance is the same as or after the second date/time instance at the specified unit level + +## Parameters + +### date1 + +[`DateInput`](../type-aliases/DateInput.md) + +### date2 + +[`DateInput`](../type-aliases/DateInput.md) + +### options + +[`IsSameOrAfterOptions`](../interfaces/IsSameOrAfterOptions.md) + +## Returns + +`boolean` diff --git a/docs/reference/functions/isSameOrBefore.md b/docs/reference/functions/isSameOrBefore.md new file mode 100644 index 00000000..352fc993 --- /dev/null +++ b/docs/reference/functions/isSameOrBefore.md @@ -0,0 +1,36 @@ +--- +id: isSameOrBefore +title: isSameOrBefore +--- + +# Function: isSameOrBefore() + +```ts +function isSameOrBefore( + date1, + date2, + options): boolean; +``` + +Defined in: [date/isSameOrBefore/isSameOrBefore.ts:25](https://github.com/TanStack/time/blob/main/packages/time/src/date/isSameOrBefore/isSameOrBefore.ts#L25) + +isSameOrBefore +Returns true if the first date/time instance is the same as or before the second date/time instance at the specified unit level + +## Parameters + +### date1 + +[`DateInput`](../type-aliases/DateInput.md) + +### date2 + +[`DateInput`](../type-aliases/DateInput.md) + +### options + +[`IsSameOrBeforeOptions`](../interfaces/IsSameOrBeforeOptions.md) + +## Returns + +`boolean` diff --git a/docs/reference/functions/isWeekend.md b/docs/reference/functions/isWeekend.md new file mode 100644 index 00000000..152c2758 --- /dev/null +++ b/docs/reference/functions/isWeekend.md @@ -0,0 +1,29 @@ +--- +id: isWeekend +title: isWeekend +--- + +# Function: isWeekend() + +```ts +function isWeekend(date, options?): boolean; +``` + +Defined in: [date/isWeekend/isWeekend.ts:14](https://github.com/TanStack/time/blob/main/packages/time/src/date/isWeekend/isWeekend.ts#L14) + +isWeekend +Returns true if the date falls on a weekend based on locale-specific week info + +## Parameters + +### date + +[`DateInput`](../type-aliases/DateInput.md) + +### options? + +[`IsWeekendOptions`](../interfaces/IsWeekendOptions.md) + +## Returns + +`boolean` diff --git a/docs/reference/functions/max.md b/docs/reference/functions/max.md new file mode 100644 index 00000000..c3572adc --- /dev/null +++ b/docs/reference/functions/max.md @@ -0,0 +1,86 @@ +--- +id: max +title: max +--- + +# Function: max() + +```ts +function max(dates, options?): object; +``` + +Defined in: [date/max/max.ts:9](https://github.com/TanStack/time/blob/main/packages/time/src/date/max/max.ts#L9) + +## Parameters + +### dates + +[`DateInput`](../type-aliases/DateInput.md)[] + +### options? + +[`MaxOptions`](../interfaces/MaxOptions.md) + +## Returns + +`object` + +### asDate() + +```ts +asDate: () => Date; +``` + +#### Returns + +`Date` + +### asEpoch() + +```ts +asEpoch: () => number; +``` + +#### Returns + +`number` + +### asZonedDateTime() + +```ts +asZonedDateTime: () => ZonedDateTime; +``` + +#### Returns + +`ZonedDateTime` + +### calendar + +```ts +calendar: string = options.calendar; +``` + +### options + +```ts +options: ResolvedDateOperationOptions; +``` + +### returnFormat + +```ts +returnFormat: ReturnFormat; +``` + +### timeZone + +```ts +timeZone: string = options.timeZone; +``` + +### value + +```ts +value: string; +``` diff --git a/docs/reference/functions/min.md b/docs/reference/functions/min.md new file mode 100644 index 00000000..2c2d494a --- /dev/null +++ b/docs/reference/functions/min.md @@ -0,0 +1,86 @@ +--- +id: min +title: min +--- + +# Function: min() + +```ts +function min(dates, options?): object; +``` + +Defined in: [date/min/min.ts:9](https://github.com/TanStack/time/blob/main/packages/time/src/date/min/min.ts#L9) + +## Parameters + +### dates + +[`DateInput`](../type-aliases/DateInput.md)[] + +### options? + +[`MinOptions`](../interfaces/MinOptions.md) + +## Returns + +`object` + +### asDate() + +```ts +asDate: () => Date; +``` + +#### Returns + +`Date` + +### asEpoch() + +```ts +asEpoch: () => number; +``` + +#### Returns + +`number` + +### asZonedDateTime() + +```ts +asZonedDateTime: () => ZonedDateTime; +``` + +#### Returns + +`ZonedDateTime` + +### calendar + +```ts +calendar: string = options.calendar; +``` + +### options + +```ts +options: ResolvedDateOperationOptions; +``` + +### returnFormat + +```ts +returnFormat: ReturnFormat; +``` + +### timeZone + +```ts +timeZone: string = options.timeZone; +``` + +### value + +```ts +value: string; +``` diff --git a/docs/reference/functions/range.md b/docs/reference/functions/range.md new file mode 100644 index 00000000..ed18d0a0 --- /dev/null +++ b/docs/reference/functions/range.md @@ -0,0 +1,26 @@ +--- +id: range +title: range +--- + +# Function: range() + +```ts +function range(options): object[]; +``` + +Defined in: [date/range/range.ts:18](https://github.com/TanStack/time/blob/main/packages/time/src/date/range/range.ts#L18) + +range +Generates an array of dates from start to end at the specified step interval. +The range is inclusive of both start and end (if end falls exactly on a step). + +## Parameters + +### options + +[`RangeOptions`](../interfaces/RangeOptions.md) + +## Returns + +`object`[] diff --git a/docs/reference/functions/round.md b/docs/reference/functions/round.md new file mode 100644 index 00000000..6156d618 --- /dev/null +++ b/docs/reference/functions/round.md @@ -0,0 +1,89 @@ +--- +id: round +title: round +--- + +# Function: round() + +```ts +function round(input, options): object; +``` + +Defined in: [date/round/round.ts:27](https://github.com/TanStack/time/blob/main/packages/time/src/date/round/round.ts#L27) + +round +Returns the date/time instance rounded to the nearest unit + +## Parameters + +### input + +[`DateInput`](../type-aliases/DateInput.md) + +### options + +[`RoundOptions`](../interfaces/RoundOptions.md) + +## Returns + +`object` + +### asDate() + +```ts +asDate: () => Date; +``` + +#### Returns + +`Date` + +### asEpoch() + +```ts +asEpoch: () => number; +``` + +#### Returns + +`number` + +### asZonedDateTime() + +```ts +asZonedDateTime: () => ZonedDateTime; +``` + +#### Returns + +`ZonedDateTime` + +### calendar + +```ts +calendar: string = options.calendar; +``` + +### options + +```ts +options: ResolvedDateOperationOptions; +``` + +### returnFormat + +```ts +returnFormat: ReturnFormat; +``` + +### timeZone + +```ts +timeZone: string = options.timeZone; +``` + +### value + +```ts +value: string; +``` diff --git a/docs/reference/functions/set.md b/docs/reference/functions/set.md new file mode 100644 index 00000000..ae22335a --- /dev/null +++ b/docs/reference/functions/set.md @@ -0,0 +1,86 @@ +--- +id: set +title: set +--- + +# Function: set() + +```ts +function set(input, options): object; +``` + +Defined in: [date/set/set.ts:21](https://github.com/TanStack/time/blob/main/packages/time/src/date/set/set.ts#L21) + +## Parameters + +### input + +[`DateInput`](../type-aliases/DateInput.md) + +### options + +[`SetOptions`](../interfaces/SetOptions.md) + +## Returns + +`object` + +### asDate() + +```ts +asDate: () => Date; +``` + +#### Returns + +`Date` + +### asEpoch() + +```ts +asEpoch: () => number; +``` + +#### Returns + +`number` + +### asZonedDateTime() + +```ts +asZonedDateTime: () => ZonedDateTime; +``` + +#### Returns + +`ZonedDateTime` + +### calendar + +```ts +calendar: string = options.calendar; +``` + +### options + +```ts +options: ResolvedDateOperationOptions; +``` + +### returnFormat + +```ts +returnFormat: ReturnFormat; +``` + +### timeZone + +```ts +timeZone: string = options.timeZone; +``` + +### value + +```ts +value: string; +``` diff --git a/docs/reference/functions/since.md b/docs/reference/functions/since.md new file mode 100644 index 00000000..3e051bea --- /dev/null +++ b/docs/reference/functions/since.md @@ -0,0 +1,37 @@ +--- +id: since +title: since +--- + +# Function: since() + +```ts +function since( + start, + end, + options): number; +``` + +Defined in: [date/since/since.ts:15](https://github.com/TanStack/time/blob/main/packages/time/src/date/since/since.ts#L15) + +since +Returns the duration from the first date/time instance since the second date/time instance +(equivalent to: how long has it been since the second date, from the first date's perspective) + +## Parameters + +### start + +[`DateInput`](../type-aliases/DateInput.md) + +### end + +[`DateInput`](../type-aliases/DateInput.md) + +### options + +[`SinceOptions`](../interfaces/SinceOptions.md) + +## Returns + +`number` diff --git a/docs/reference/functions/splitMultiDayEvents.md b/docs/reference/functions/splitMultiDayEvents.md new file mode 100644 index 00000000..60d9dbf4 --- /dev/null +++ b/docs/reference/functions/splitMultiDayEvents.md @@ -0,0 +1,36 @@ +--- +id: splitMultiDayEvents +title: splitMultiDayEvents +--- + +# Function: splitMultiDayEvents() + +```ts +function splitMultiDayEvents(event, timeZone): TEvent[]; +``` + +Defined in: [calendar/splitMultiDayEvents.ts:5](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/splitMultiDayEvents.ts#L5) + +## Type Parameters + +### TResource + +`TResource` *extends* [`Resource`](../interfaces/Resource.md) = [`Resource`](../interfaces/Resource.md) + +### TEvent + +`TEvent` *extends* [`Event`](../interfaces/Event.md)\<`TResource`\> = [`Event`](../interfaces/Event.md)\<`TResource`\> + +## Parameters + +### event + +`TEvent` + +### timeZone + +`TimeZoneLike` + +## Returns + +`TEvent`[] diff --git a/docs/reference/functions/startOf.md b/docs/reference/functions/startOf.md new file mode 100644 index 00000000..d0d5e8af --- /dev/null +++ b/docs/reference/functions/startOf.md @@ -0,0 +1,89 @@ +--- +id: startOf +title: startOf +--- + +# Function: startOf() + +```ts +function startOf(input, options): object; +``` + +Defined in: [date/startOf/startOf.ts:23](https://github.com/TanStack/time/blob/main/packages/time/src/date/startOf/startOf.ts#L23) + +startOf +Returns the start of a given unit for a date/time instance + +## Parameters + +### input + +[`DateInput`](../type-aliases/DateInput.md) + +### options + +[`StartOfOptions`](../interfaces/StartOfOptions.md) + +## Returns + +`object` + +### asDate() + +```ts +asDate: () => Date; +``` + +#### Returns + +`Date` + +### asEpoch() + +```ts +asEpoch: () => number; +``` + +#### Returns + +`number` + +### asZonedDateTime() + +```ts +asZonedDateTime: () => ZonedDateTime; +``` + +#### Returns + +`ZonedDateTime` + +### calendar + +```ts +calendar: string = options.calendar; +``` + +### options + +```ts +options: ResolvedDateOperationOptions; +``` + +### returnFormat + +```ts +returnFormat: ReturnFormat; +``` + +### timeZone + +```ts +timeZone: string = options.timeZone; +``` + +### value + +```ts +value: string; +``` diff --git a/docs/reference/functions/subtract.md b/docs/reference/functions/subtract.md new file mode 100644 index 00000000..2beb5399 --- /dev/null +++ b/docs/reference/functions/subtract.md @@ -0,0 +1,89 @@ +--- +id: subtract +title: subtract +--- + +# Function: subtract() + +```ts +function subtract(input, options): object; +``` + +Defined in: [date/subtract/subtract.ts:13](https://github.com/TanStack/time/blob/main/packages/time/src/date/subtract/subtract.ts#L13) + +subtract +Subtracts a duration from a date/time instance + +## Parameters + +### input + +[`DateInput`](../type-aliases/DateInput.md) + +### options + +[`SubtractOptions`](../interfaces/SubtractOptions.md) + +## Returns + +`object` + +### asDate() + +```ts +asDate: () => Date; +``` + +#### Returns + +`Date` + +### asEpoch() + +```ts +asEpoch: () => number; +``` + +#### Returns + +`number` + +### asZonedDateTime() + +```ts +asZonedDateTime: () => ZonedDateTime; +``` + +#### Returns + +`ZonedDateTime` + +### calendar + +```ts +calendar: string = options.calendar; +``` + +### options + +```ts +options: ResolvedDateOperationOptions; +``` + +### returnFormat + +```ts +returnFormat: ReturnFormat; +``` + +### timeZone + +```ts +timeZone: string = options.timeZone; +``` + +### value + +```ts +value: string; +``` diff --git a/docs/reference/functions/toDate.md b/docs/reference/functions/toDate.md new file mode 100644 index 00000000..7d3b41a6 --- /dev/null +++ b/docs/reference/functions/toDate.md @@ -0,0 +1,26 @@ +--- +id: toDate +title: toDate +--- + +# Function: toDate() + +```ts +function toDate(value): Date; +``` + +Defined in: [date/parse/parse.ts:221](https://github.com/TanStack/time/blob/main/packages/time/src/date/parse/parse.ts#L221) + +toDate +Converts a flexible date/time input (string, Date, or epoch number) +into a local-time Date at midnight, extracting only the date portion. + +## Parameters + +### value + +`string` | `number` | `Date` + +## Returns + +`Date` diff --git a/docs/reference/functions/toPlainDateString.md b/docs/reference/functions/toPlainDateString.md new file mode 100644 index 00000000..5acab94b --- /dev/null +++ b/docs/reference/functions/toPlainDateString.md @@ -0,0 +1,26 @@ +--- +id: toPlainDateString +title: toPlainDateString +--- + +# Function: toPlainDateString() + +```ts +function toPlainDateString(value): string; +``` + +Defined in: [date/parse/parse.ts:201](https://github.com/TanStack/time/blob/main/packages/time/src/date/parse/parse.ts#L201) + +toPlainDateString +Converts a flexible date/time input (string, Date, or epoch number) +into a Temporal.PlainDate-compatible ISO string (YYYY-MM-DD). + +## Parameters + +### value + +`string` | `number` | `Date` + +## Returns + +`string` diff --git a/docs/reference/functions/toPlainDateTimeString.md b/docs/reference/functions/toPlainDateTimeString.md new file mode 100644 index 00000000..a90b8174 --- /dev/null +++ b/docs/reference/functions/toPlainDateTimeString.md @@ -0,0 +1,26 @@ +--- +id: toPlainDateTimeString +title: toPlainDateTimeString +--- + +# Function: toPlainDateTimeString() + +```ts +function toPlainDateTimeString(value): string; +``` + +Defined in: [date/parse/parse.ts:191](https://github.com/TanStack/time/blob/main/packages/time/src/date/parse/parse.ts#L191) + +toPlainDateTimeString +Converts a flexible date/time input (string, Date, or epoch number) +into a Temporal.PlainDateTime-compatible ISO string (YYYY-MM-DDTHH:mm:ss). + +## Parameters + +### value + +`string` | `number` | `Date` + +## Returns + +`string` diff --git a/docs/reference/functions/toPlainTimeString.md b/docs/reference/functions/toPlainTimeString.md new file mode 100644 index 00000000..ee99e560 --- /dev/null +++ b/docs/reference/functions/toPlainTimeString.md @@ -0,0 +1,26 @@ +--- +id: toPlainTimeString +title: toPlainTimeString +--- + +# Function: toPlainTimeString() + +```ts +function toPlainTimeString(value): string; +``` + +Defined in: [date/parse/parse.ts:211](https://github.com/TanStack/time/blob/main/packages/time/src/date/parse/parse.ts#L211) + +toPlainTimeString +Converts a flexible date/time input (string, Date, or epoch number) +into a time-only string (HH:mm). + +## Parameters + +### value + +`string` | `number` | `Date` + +## Returns + +`string` diff --git a/docs/reference/functions/until.md b/docs/reference/functions/until.md new file mode 100644 index 00000000..298e3e3e --- /dev/null +++ b/docs/reference/functions/until.md @@ -0,0 +1,36 @@ +--- +id: until +title: until +--- + +# Function: until() + +```ts +function until( + start, + end, + options): number; +``` + +Defined in: [date/until/until.ts:14](https://github.com/TanStack/time/blob/main/packages/time/src/date/until/until.ts#L14) + +until +Returns the duration from the first date/time instance until the second date/time instance + +## Parameters + +### start + +[`DateInput`](../type-aliases/DateInput.md) + +### end + +[`DateInput`](../type-aliases/DateInput.md) + +### options + +[`UntilOptions`](../interfaces/UntilOptions.md) + +## Returns + +`number` diff --git a/docs/reference/index.md b/docs/reference/index.md new file mode 100644 index 00000000..cc22762b --- /dev/null +++ b/docs/reference/index.md @@ -0,0 +1,167 @@ +--- +id: "@tanstack/time" +title: "@tanstack/time" +--- + +# @tanstack/time + +## Classes + +- [CalendarCore](classes/CalendarCore.md) +- [DateCore](classes/DateCore.md) +- [ResizeController](classes/ResizeController.md) + +## Interfaces + +- [AddOptions](interfaces/AddOptions.md) +- [Availability](interfaces/Availability.md) +- [AvailabilityConflict](interfaces/AvailabilityConflict.md) +- [CalendarApi](interfaces/CalendarApi.md) +- [CalendarCoreOptions](interfaces/CalendarCoreOptions.md) +- [CalendarStore](interfaces/CalendarStore.md) +- [CeilOptions](interfaces/CeilOptions.md) +- [ClampOptions](interfaces/ClampOptions.md) +- [CountOptions](interfaces/CountOptions.md) +- [DateCoreOptions](interfaces/DateCoreOptions.md) +- [DateOptions](interfaces/DateOptions.md) +- [DateRange](interfaces/DateRange.md) +- [EndOfOptions](interfaces/EndOfOptions.md) +- [EqualsOptions](interfaces/EqualsOptions.md) +- [Event](interfaces/Event.md) +- [EventDependency](interfaces/EventDependency.md) +- [EventTimeRange](interfaces/EventTimeRange.md) +- [FormatDateOptions](interfaces/FormatDateOptions.md) +- [FormatEventTimeOptions](interfaces/FormatEventTimeOptions.md) +- [FormattedEventTime](interfaces/FormattedEventTime.md) +- [FromUnixTimeOptions](interfaces/FromUnixTimeOptions.md) +- [GetDayOfYearOptions](interfaces/GetDayOfYearOptions.md) +- [GetUnixTimeOptions](interfaces/GetUnixTimeOptions.md) +- [GetWeekOptions](interfaces/GetWeekOptions.md) +- [GhostPreviewOptions](interfaces/GhostPreviewOptions.md) +- [IntersectsOptions](interfaces/IntersectsOptions.md) +- [IsAfterOptions](interfaces/IsAfterOptions.md) +- [IsBeforeOptions](interfaces/IsBeforeOptions.md) +- [IsBetweenOptions](interfaces/IsBetweenOptions.md) +- [IsFutureOptions](interfaces/IsFutureOptions.md) +- [IsLeapYearOptions](interfaces/IsLeapYearOptions.md) +- [IsPastOptions](interfaces/IsPastOptions.md) +- [IsSameOrAfterOptions](interfaces/IsSameOrAfterOptions.md) +- [IsSameOrBeforeOptions](interfaces/IsSameOrBeforeOptions.md) +- [IsWeekendOptions](interfaces/IsWeekendOptions.md) +- [MaxOptions](interfaces/MaxOptions.md) +- [MinOptions](interfaces/MinOptions.md) +- [ParsedDateCoreOptions](interfaces/ParsedDateCoreOptions.md) +- [PositionStyle](interfaces/PositionStyle.md) +- [Range](interfaces/Range.md) +- [RangeOptions](interfaces/RangeOptions.md) +- [RecurrenceOverride](interfaces/RecurrenceOverride.md) +- [RecurrenceRule](interfaces/RecurrenceRule.md) +- [ResizeConstraints](interfaces/ResizeConstraints.md) +- [ResizeControllerOptions](interfaces/ResizeControllerOptions.md) +- [ResizeError](interfaces/ResizeError.md) +- [ResizeHandleStyle](interfaces/ResizeHandleStyle.md) +- [ResizePreviewOptions](interfaces/ResizePreviewOptions.md) +- [ResizeStartArgs](interfaces/ResizeStartArgs.md) +- [ResizeState](interfaces/ResizeState.md) +- [ResizeValidationResult](interfaces/ResizeValidationResult.md) +- [Resource](interfaces/Resource.md) +- [RoundOptions](interfaces/RoundOptions.md) +- [SegmentInfo](interfaces/SegmentInfo.md) +- [SegmentResizePreview](interfaces/SegmentResizePreview.md) +- [SetFields](interfaces/SetFields.md) +- [SetOptions](interfaces/SetOptions.md) +- [SinceOptions](interfaces/SinceOptions.md) +- [StartOfOptions](interfaces/StartOfOptions.md) +- [SubtractOptions](interfaces/SubtractOptions.md) +- [TimeEventInfo](interfaces/TimeEventInfo.md) +- [TimeEventMap](interfaces/TimeEventMap.md) +- [TimelineEventLayout](interfaces/TimelineEventLayout.md) +- [TimelineLayout](interfaces/TimelineLayout.md) +- [TimelineResizePreviewOptions](interfaces/TimelineResizePreviewOptions.md) +- [TimelineResizePreviewStyle](interfaces/TimelineResizePreviewStyle.md) +- [TimelineResourceRow](interfaces/TimelineResourceRow.md) +- [TimeSlot](interfaces/TimeSlot.md) +- [UnavailabilityReason](interfaces/UnavailabilityReason.md) +- [UnavailableRange](interfaces/UnavailableRange.md) +- [UnavailableTimeRange](interfaces/UnavailableTimeRange.md) +- [UntilOptions](interfaces/UntilOptions.md) +- [ValidateResizeOptions](interfaces/ValidateResizeOptions.md) +- [ValidateResizeResult](interfaces/ValidateResizeResult.md) +- [ViewMode](interfaces/ViewMode.md) + +## Type Aliases + +- [CeilUnit](type-aliases/CeilUnit.md) +- [CountUnit](type-aliases/CountUnit.md) +- [DateInput](type-aliases/DateInput.md) +- [Day](type-aliases/Day.md) +- [DependencyType](type-aliases/DependencyType.md) +- [DurationLike](type-aliases/DurationLike.md) +- [EndOfUnit](type-aliases/EndOfUnit.md) +- [EqualsUnit](type-aliases/EqualsUnit.md) +- [EventDateTimeInput](type-aliases/EventDateTimeInput.md) +- [FormatType](type-aliases/FormatType.md) +- [GroupDaysByProps](type-aliases/GroupDaysByProps.md) +- [IsSameOrAfterUnit](type-aliases/IsSameOrAfterUnit.md) +- [IsSameOrBeforeUnit](type-aliases/IsSameOrBeforeUnit.md) +- [RecurrenceEditScope](type-aliases/RecurrenceEditScope.md) +- [RecurrenceFrequency](type-aliases/RecurrenceFrequency.md) +- [ResizeEdge](type-aliases/ResizeEdge.md) +- [ResizeListener](type-aliases/ResizeListener.md) +- [RoundUnit](type-aliases/RoundUnit.md) +- [SaveEventResult](type-aliases/SaveEventResult.md) +- [StartOfUnit](type-aliases/StartOfUnit.md) + +## Functions + +- [add](functions/add.md) +- [calculateDeltaMinutesFromPixels](functions/calculateDeltaMinutesFromPixels.md) +- [calculateDeltaMinutesFromPixelsHorizontal](functions/calculateDeltaMinutesFromPixelsHorizontal.md) +- [calculateGhostPreviewStyle](functions/calculateGhostPreviewStyle.md) +- [calculateResizedEvent](functions/calculateResizedEvent.md) +- [calculateSegmentResizePreview](functions/calculateSegmentResizePreview.md) +- [calculateTimelineResizePreview](functions/calculateTimelineResizePreview.md) +- [ceil](functions/ceil.md) +- [clamp](functions/clamp.md) +- [count](functions/count.md) +- [endOf](functions/endOf.md) +- [equals](functions/equals.md) +- [format](functions/format.md) +- [formatEventTimeRange](functions/formatEventTimeRange.md) +- [fromUnixTime](functions/fromUnixTime.md) +- [generateDateRange](functions/generateDateRange.md) +- [getDayOfYear](functions/getDayOfYear.md) +- [getEventDisplayTimeRange](functions/getEventDisplayTimeRange.md) +- [getEventProps](functions/getEventProps.md) +- [getResizeHandleStyle](functions/getResizeHandleStyle.md) +- [getSegmentInfo](functions/getSegmentInfo.md) +- [getTimeClient](functions/getTimeClient.md) +- [getTimeSlots](functions/getTimeSlots.md) +- [getUnixTime](functions/getUnixTime.md) +- [getWeek](functions/getWeek.md) +- [groupDaysBy](functions/groupDaysBy.md) +- [intersects](functions/intersects.md) +- [isAfter](functions/isAfter.md) +- [isBefore](functions/isBefore.md) +- [isBetween](functions/isBetween.md) +- [isFuture](functions/isFuture.md) +- [isLeapYear](functions/isLeapYear.md) +- [isMultiDayEvent](functions/isMultiDayEvent.md) +- [isPast](functions/isPast.md) +- [isSameOrAfter](functions/isSameOrAfter.md) +- [isSameOrBefore](functions/isSameOrBefore.md) +- [isWeekend](functions/isWeekend.md) +- [max](functions/max.md) +- [min](functions/min.md) +- [range](functions/range.md) +- [round](functions/round.md) +- [set](functions/set.md) +- [since](functions/since.md) +- [splitMultiDayEvents](functions/splitMultiDayEvents.md) +- [startOf](functions/startOf.md) +- [subtract](functions/subtract.md) +- [toDate](functions/toDate.md) +- [toPlainDateString](functions/toPlainDateString.md) +- [toPlainDateTimeString](functions/toPlainDateTimeString.md) +- [toPlainTimeString](functions/toPlainTimeString.md) +- [until](functions/until.md) diff --git a/docs/reference/interfaces/AddOptions.md b/docs/reference/interfaces/AddOptions.md new file mode 100644 index 00000000..250d3345 --- /dev/null +++ b/docs/reference/interfaces/AddOptions.md @@ -0,0 +1,70 @@ +--- +id: AddOptions +title: AddOptions +--- + +# Interface: AddOptions + +Defined in: [date/add/add.ts:5](https://github.com/TanStack/time/blob/main/packages/time/src/date/add/add.ts#L5) + +## Extends + +- `DateOperationOptions` + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +```ts +DateOperationOptions.calendar +``` + +*** + +### duration + +```ts +duration: DurationLike; +``` + +Defined in: [date/add/add.ts:6](https://github.com/TanStack/time/blob/main/packages/time/src/date/add/add.ts#L6) + +*** + +### returnFormat? + +```ts +optional returnFormat: ReturnFormat; +``` + +Defined in: [date/withDateOperation/withDateOperation.ts:9](https://github.com/TanStack/time/blob/main/packages/time/src/date/withDateOperation/withDateOperation.ts#L9) + +#### Inherited from + +```ts +DateOperationOptions.returnFormat +``` + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +```ts +DateOperationOptions.timeZone +``` diff --git a/docs/reference/interfaces/Availability.md b/docs/reference/interfaces/Availability.md new file mode 100644 index 00000000..f8870f33 --- /dev/null +++ b/docs/reference/interfaces/Availability.md @@ -0,0 +1,44 @@ +--- +id: Availability +title: Availability +--- + +# Interface: Availability + +Defined in: [calendar/types.ts:70](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L70) + +## Properties + +### endTime + +```ts +endTime: string; +``` + +Defined in: [calendar/types.ts:76](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L76) + +End time in HH:mm format + +*** + +### startTime + +```ts +startTime: string; +``` + +Defined in: [calendar/types.ts:74](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L74) + +Start time in HH:mm format + +*** + +### weekdays + +```ts +weekdays: number[]; +``` + +Defined in: [calendar/types.ts:72](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L72) + +Days of the week when available (ISO weekday: 1 = Monday, ..., 7 = Sunday) diff --git a/docs/reference/interfaces/AvailabilityConflict.md b/docs/reference/interfaces/AvailabilityConflict.md new file mode 100644 index 00000000..0323892d --- /dev/null +++ b/docs/reference/interfaces/AvailabilityConflict.md @@ -0,0 +1,82 @@ +--- +id: AvailabilityConflict +title: AvailabilityConflict +--- + +# Interface: AvailabilityConflict + +Defined in: [calendar/types.ts:206](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L206) + +Information about a specific availability conflict + +## Properties + +### conflictRange + +```ts +conflictRange: object; +``` + +Defined in: [calendar/types.ts:210](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L210) + +Time range that conflicts with availability + +#### end + +```ts +end: string; +``` + +#### start + +```ts +start: string; +``` + +*** + +### date + +```ts +date: string; +``` + +Defined in: [calendar/types.ts:208](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L208) + +The date where the conflict occurred (YYYY-MM-DD) + +*** + +### description + +```ts +description: string; +``` + +Defined in: [calendar/types.ts:219](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L219) + +Human-readable description of the conflict + +*** + +### resourceDetails + +```ts +resourceDetails: UnavailabilityReason[]; +``` + +Defined in: [calendar/types.ts:217](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L217) + +Detailed reasons for each resource + +*** + +### resourceIds + +```ts +resourceIds: string[]; +``` + +Defined in: [calendar/types.ts:215](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L215) + +The resource(s) whose availability is being violated diff --git a/docs/reference/interfaces/CalendarApi.md b/docs/reference/interfaces/CalendarApi.md new file mode 100644 index 00000000..f7f4c3d0 --- /dev/null +++ b/docs/reference/interfaces/CalendarApi.md @@ -0,0 +1,1402 @@ +--- +id: CalendarApi +title: CalendarApi +--- + +# Interface: CalendarApi\ + +Defined in: [calendar/calendar.ts:283](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L283) + +## Extends + +- `CalendarActions`\<`TResource`, `TEvent`\>.`ConvertTemporalToString`\<`CalendarState`\<`TResource`, `TEvent`\>\> + +## Type Parameters + +### TResource + +`TResource` *extends* [`Resource`](Resource.md) + +### TEvent + +`TEvent` *extends* [`Event`](Event.md)\<`TResource`\> + +## Properties + +### activeDate + +```ts +activeDate: string; +``` + +Defined in: [calendar/calendar.ts:276](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L276) + +The currently active date in the calendar. + +#### Inherited from + +```ts +ConvertTemporalToString.activeDate +``` + +*** + +### addEvent() + +```ts +addEvent: (event, options?) => Promise; +``` + +Defined in: [calendar/calendar.ts:147](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L147) + +Fetches events for the event's date range, validates placement +constraints, and adds the event if valid. Returns a result +indicating success or a validation error. + +#### Parameters + +##### event + +`TEvent` + +##### options? + +###### dependsOn? + +[`EventDependency`](EventDependency.md)[] + +#### Returns + +`Promise`\<[`SaveEventResult`](../type-aliases/SaveEventResult.md)\> + +#### Inherited from + +```ts +CalendarActions.addEvent +``` + +*** + +### canGoNextPeriod() + +```ts +canGoNextPeriod: () => boolean; +``` + +Defined in: [calendar/calendar.ts:93](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L93) + +Checks if navigation to the next period is allowed within the range. + +#### Returns + +`boolean` + +#### Inherited from + +```ts +CalendarActions.canGoNextPeriod +``` + +*** + +### canGoPreviousPeriod() + +```ts +canGoPreviousPeriod: () => boolean; +``` + +Defined in: [calendar/calendar.ts:91](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L91) + +Checks if navigation to the previous period is allowed within the range. + +#### Returns + +`boolean` + +#### Inherited from + +```ts +CalendarActions.canGoPreviousPeriod +``` + +*** + +### canRedo() + +```ts +canRedo: () => boolean; +``` + +Defined in: [calendar/calendar.ts:215](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L215) + +Returns true when there is at least one action to redo. + +#### Returns + +`boolean` + +#### Inherited from + +```ts +CalendarActions.canRedo +``` + +*** + +### canUndo() + +```ts +canUndo: () => boolean; +``` + +Defined in: [calendar/calendar.ts:213](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L213) + +Returns true when there is at least one action to undo. + +#### Returns + +`boolean` + +#### Inherited from + +```ts +CalendarActions.canUndo +``` + +*** + +### changeViewMode() + +```ts +changeViewMode: (newViewMode) => void; +``` + +Defined in: [calendar/calendar.ts:112](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L112) + +Changes the current view mode of the calendar. + +#### Parameters + +##### newViewMode + +[`ViewMode`](ViewMode.md) + +#### Returns + +`void` + +#### Inherited from + +```ts +CalendarActions.changeViewMode +``` + +*** + +### createDependency() + +```ts +createDependency: (sourceId, targetId, type?) => object; +``` + +Defined in: [calendar/calendar.ts:238](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L238) + +Creates a dependency link from source to target event. +If the target event starts before the source event ends, it will optionally reschedule the target. + +#### Parameters + +##### sourceId + +`string` + +##### targetId + +`string` + +##### type? + +[`DependencyType`](../type-aliases/DependencyType.md) + +#### Returns + +`object` + +##### blocked + +```ts +blocked: boolean; +``` + +##### error? + +```ts +optional error: ResizeError; +``` + +#### Inherited from + +```ts +CalendarActions.createDependency +``` + +*** + +### currentPeriod + +```ts +currentPeriod: string; +``` + +Defined in: [calendar/calendar.ts:270](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L270) + +The currently focused date period in the calendar. + +#### Inherited from + +```ts +ConvertTemporalToString.currentPeriod +``` + +*** + +### days + +```ts +days: Day[]; +``` + +Defined in: [calendar/calendar.ts:274](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L274) + +An array of days, each potentially containing events. + +#### Inherited from + +```ts +ConvertTemporalToString.days +``` + +*** + +### editEvent() + +```ts +editEvent: (eventId, updates, options?) => Promise; +``` + +Defined in: [calendar/calendar.ts:156](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L156) + +Fetches events for the event's date range, validates move constraints +(and cascading dependents), and updates the event if valid. +Returns a result indicating success or a validation error. + +#### Parameters + +##### eventId + +`string` + +##### updates + +`Partial`\<`Omit`\<`TEvent`, `"id"`\>\> + +##### options? + +###### dependsOn? + +[`EventDependency`](EventDependency.md)[] + +#### Returns + +`Promise`\<[`SaveEventResult`](../type-aliases/SaveEventResult.md)\> + +#### Inherited from + +```ts +CalendarActions.editEvent +``` + +*** + +### editRecurringEvent() + +```ts +editRecurringEvent: (eventId, updates, options) => Promise; +``` + +Defined in: [calendar/calendar.ts:162](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L162) + +Edits one occurrence, this-and-following occurrences, or the whole recurring series. + +#### Parameters + +##### eventId + +`string` + +##### updates + +`Partial`\<`Omit`\<`TEvent`, `"id"`\>\> + +##### options + +###### dependsOn? + +[`EventDependency`](EventDependency.md)[] + +###### occurrenceStart? + +[`EventDateTimeInput`](../type-aliases/EventDateTimeInput.md) + +###### scope + +[`RecurrenceEditScope`](../type-aliases/RecurrenceEditScope.md) + +#### Returns + +`Promise`\<[`SaveEventResult`](../type-aliases/SaveEventResult.md)\> + +#### Inherited from + +```ts +CalendarActions.editRecurringEvent +``` + +*** + +### fetchEventsForRange() + +```ts +fetchEventsForRange: (start, end) => Promise; +``` + +Defined in: [calendar/calendar.ts:249](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L249) + +Fetches events for an arbitrary date range from the configured +`fetchEvents` callback and merges them into the calendar. +Resolves immediately if `fetchEvents` is not configured or the range +is already loaded. + +#### Parameters + +##### start + +`string` + +##### end + +`string` + +#### Returns + +`Promise`\<`void`\> + +#### Inherited from + +```ts +CalendarActions.fetchEventsForRange +``` + +*** + +### formatCurrentPeriod() + +```ts +formatCurrentPeriod: (options?) => string; +``` + +Defined in: [calendar/calendar.ts:196](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L196) + +Formats the current period as a human-readable "Month Year" string (e.g. "January 2024"). + +#### Parameters + +##### options? + +###### locale? + +`string` + +#### Returns + +`string` + +#### Inherited from + +```ts +CalendarActions.formatCurrentPeriod +``` + +*** + +### formatPeriodLabel() + +```ts +formatPeriodLabel: (options?) => string; +``` + +Defined in: [calendar/calendar.ts:194](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L194) + +Returns a human-readable label for the currently visible date range. + +#### Parameters + +##### options? + +###### locale? + +`string` + +#### Returns + +`string` + +#### Inherited from + +```ts +CalendarActions.formatPeriodLabel +``` + +*** + +### getAllDayEventsByDate() + +```ts +getAllDayEventsByDate: (date) => TEvent[]; +``` + +Defined in: [calendar/calendar.ts:141](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L141) + +Retrieves all-day events occurring on a specific date (multi-day all-day segments included). + +#### Parameters + +##### date + +`string` + +#### Returns + +`TEvent`[] + +#### Inherited from + +```ts +CalendarActions.getAllDayEventsByDate +``` + +*** + +### getDaysInRange() + +```ts +getDaysInRange: (start, end) => Day[]; +``` + +Defined in: [calendar/calendar.ts:205](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L205) + +Returns Day objects for every date between `start` and `end` (inclusive), +derived freshly from current event state. Useful for buffered/infinite-scroll +UIs that need to render a range wider than the current period without +caching stale Day snapshots. + +#### Parameters + +##### start + +`string` + +##### end + +`string` + +#### Returns + +[`Day`](../type-aliases/Day.md)\<`TResource`, `TEvent`\>[] + +#### Inherited from + +```ts +CalendarActions.getDaysInRange +``` + +*** + +### getDaysNames() + +```ts +getDaysNames: (weekday?) => string[]; +``` + +Defined in: [calendar/calendar.ts:127](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L127) + +Retrieves the names of the days of the week, based on the current locale. + +#### Parameters + +##### weekday? + +`"long"` | `"short"` + +#### Returns + +`string`[] + +#### Inherited from + +```ts +CalendarActions.getDaysNames +``` + +*** + +### getEventProps() + +```ts +getEventProps: (event) => object; +``` + +Defined in: [calendar/calendar.ts:114](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L114) + +Retrieves styling properties for a specific event. + +#### Parameters + +##### event + +`TEvent` + +#### Returns + +`object` + +##### end + +```ts +end: string; +``` + +##### isSplitEvent + +```ts +isSplitEvent: boolean; +``` + +##### overlappingEvents + +```ts +overlappingEvents: TEvent[]; +``` + +##### start + +```ts +start: string; +``` + +##### style? + +```ts +optional style: object; +``` + +###### style.height + +```ts +height: string; +``` + +###### style.left + +```ts +left: string; +``` + +###### style.top + +```ts +top: string; +``` + +###### style.width + +```ts +width: string; +``` + +#### Inherited from + +```ts +CalendarActions.getEventProps +``` + +*** + +### getEvents() + +```ts +getEvents: () => TEvent[]; +``` + +Defined in: [calendar/calendar.ts:207](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L207) + +Returns a snapshot of all events currently managed by the calendar (including those outside the visible range). + +#### Returns + +`TEvent`[] + +#### Inherited from + +```ts +CalendarActions.getEvents +``` + +*** + +### getEventsByDate() + +```ts +getEventsByDate: (date) => TEvent[]; +``` + +Defined in: [calendar/calendar.ts:139](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L139) + +Retrieves all events for a specific date. + +#### Parameters + +##### date + +`string` + +#### Returns + +`TEvent`[] + +#### Inherited from + +```ts +CalendarActions.getEventsByDate +``` + +*** + +### getEventsByResource() + +```ts +getEventsByResource: () => Map; +``` + +Defined in: [calendar/calendar.ts:190](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L190) + +Groups visible events by resource, merging multi-day segments back to full-span events. + +#### Returns + +`Map`\<`TResource`\[`"id"`\], `TEvent`[]\> + +#### Inherited from + +```ts +CalendarActions.getEventsByResource +``` + +*** + +### getEventSegmentInfo() + +```ts +getEventSegmentInfo: (event) => SegmentInfo; +``` + +Defined in: [calendar/calendar.ts:198](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L198) + +Returns segment info (split/occurrence metadata) for an event, normalising flexible datetime inputs. + +#### Parameters + +##### event + +`TEvent` + +#### Returns + +[`SegmentInfo`](SegmentInfo.md) + +#### Inherited from + +```ts +CalendarActions.getEventSegmentInfo +``` + +*** + +### getMasterEvent() + +```ts +getMasterEvent: (event) => TEvent; +``` + +Defined in: [calendar/calendar.ts:110](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L110) + +Returns the master event for a given occurrence (or the event itself if it is already the master). + +#### Parameters + +##### event + +`TEvent` + +#### Returns + +`TEvent` + +#### Inherited from + +```ts +CalendarActions.getMasterEvent +``` + +*** + +### getTimelineLayout() + +```ts +getTimelineLayout: () => TimelineLayout; +``` + +Defined in: [calendar/calendar.ts:192](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L192) + +Computes horizontal timeline layout with event positions, lane assignments, and current time marker. + +#### Returns + +[`TimelineLayout`](TimelineLayout.md)\<`TResource`, `TEvent`\> + +#### Inherited from + +```ts +CalendarActions.getTimelineLayout +``` + +*** + +### getTimeSlots() + +```ts +getTimeSlots: (options?) => TimeSlot[]; +``` + +Defined in: [calendar/calendar.ts:135](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L135) + +Retrieves time slots for day view with configurable intervals. + +#### Parameters + +##### options? + +`TimeSlotOptions` + +#### Returns + +[`TimeSlot`](TimeSlot.md)[] + +#### Inherited from + +```ts +CalendarActions.getTimeSlots +``` + +*** + +### getUnavailableRanges() + +```ts +getUnavailableRanges: (date, options?) => UnavailableRange[]; +``` + +Defined in: [calendar/calendar.ts:182](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L182) + +Retrieves unavailable time ranges for a specific date based on resource availability. + +#### Parameters + +##### date + +`string` + +##### options? + +###### containerHeight? + +`number` + +###### resourceIds? + +`TResource`\[`"id"`\][] + +#### Returns + +[`UnavailableRange`](UnavailableRange.md)[] + +#### Inherited from + +```ts +CalendarActions.getUnavailableRanges +``` + +*** + +### goToCurrentPeriod() + +```ts +goToCurrentPeriod: () => void; +``` + +Defined in: [calendar/calendar.ts:87](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L87) + +Resets the view to the current period based on today's date. + +#### Returns + +`void` + +#### Inherited from + +```ts +CalendarActions.goToCurrentPeriod +``` + +*** + +### goToNextOccurrence() + +```ts +goToNextOccurrence: (eventId, fromDate?) => void; +``` + +Defined in: [calendar/calendar.ts:98](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L98) + +Navigates to the next occurrence of a recurring event after fromDate (defaults to activeDate). +No-op when the event is not recurring or has no future occurrences. + +#### Parameters + +##### eventId + +`string` + +##### fromDate? + +[`EventDateTimeInput`](../type-aliases/EventDateTimeInput.md) + +#### Returns + +`void` + +#### Inherited from + +```ts +CalendarActions.goToNextOccurrence +``` + +*** + +### goToNextPeriod() + +```ts +goToNextPeriod: () => void; +``` + +Defined in: [calendar/calendar.ts:85](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L85) + +Navigates to the next period according to the current view mode. + +#### Returns + +`void` + +#### Inherited from + +```ts +CalendarActions.goToNextPeriod +``` + +*** + +### goToPreviousOccurrence() + +```ts +goToPreviousOccurrence: (eventId, fromDate?) => void; +``` + +Defined in: [calendar/calendar.ts:103](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L103) + +Navigates to the previous occurrence of a recurring event before fromDate (defaults to activeDate). +No-op when the event is not recurring or is already at the first occurrence. + +#### Parameters + +##### eventId + +`string` + +##### fromDate? + +[`EventDateTimeInput`](../type-aliases/EventDateTimeInput.md) + +#### Returns + +`void` + +#### Inherited from + +```ts +CalendarActions.goToPreviousOccurrence +``` + +*** + +### goToPreviousPeriod() + +```ts +goToPreviousPeriod: () => void; +``` + +Defined in: [calendar/calendar.ts:83](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L83) + +Navigates to the previous period according to the current view mode. + +#### Returns + +`void` + +#### Inherited from + +```ts +CalendarActions.goToPreviousPeriod +``` + +*** + +### goToSpecificPeriod() + +```ts +goToSpecificPeriod: (date) => void; +``` + +Defined in: [calendar/calendar.ts:89](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L89) + +Navigates to a specific date. + +#### Parameters + +##### date + +`string` + +#### Returns + +`void` + +#### Inherited from + +```ts +CalendarActions.goToSpecificPeriod +``` + +*** + +### groupDaysBy() + +```ts +groupDaysBy: (props) => (Day | null)[][]; +``` + +Defined in: [calendar/calendar.ts:129](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L129) + +Groups days by a specified unit. + +#### Parameters + +##### props + +###### days + +([`Day`](../type-aliases/Day.md)\<`TResource`, `TEvent`\> \| `null`)[] + +###### fillMissingDays? + +`boolean` + +###### unit + +`"week"` \| `"workWeek"` + +#### Returns + +([`Day`](../type-aliases/Day.md)\<`TResource`, `TEvent`\> \| `null`)[][] + +#### Inherited from + +```ts +CalendarActions.groupDaysBy +``` + +*** + +### redo() + +```ts +redo: () => void; +``` + +Defined in: [calendar/calendar.ts:211](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L211) + +Re-applies the last undone action. + +#### Returns + +`void` + +#### Inherited from + +```ts +CalendarActions.redo +``` + +*** + +### removeEvent() + +```ts +removeEvent: (id) => void; +``` + +Defined in: [calendar/calendar.ts:180](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L180) + +Removes an event by ID. + +#### Parameters + +##### id + +`string` + +#### Returns + +`void` + +#### Inherited from + +```ts +CalendarActions.removeEvent +``` + +*** + +### removeRecurringEvent() + +```ts +removeRecurringEvent: (eventId, options) => void; +``` + +Defined in: [calendar/calendar.ts:172](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L172) + +Removes one occurrence, this-and-following occurrences, or the whole recurring series. + +#### Parameters + +##### eventId + +`string` + +##### options + +###### occurrenceStart? + +[`EventDateTimeInput`](../type-aliases/EventDateTimeInput.md) + +###### scope + +[`RecurrenceEditScope`](../type-aliases/RecurrenceEditScope.md) + +#### Returns + +`void` + +#### Inherited from + +```ts +CalendarActions.removeRecurringEvent +``` + +*** + +### setEvents() + +```ts +setEvents: (events) => void; +``` + +Defined in: [calendar/calendar.ts:262](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L262) + +#### Parameters + +##### events + +`TEvent`[] | `null` + +#### Returns + +`void` + +#### Inherited from + +```ts +CalendarActions.setEvents +``` + +*** + +### setResources() + +```ts +setResources: (resources) => void; +``` + +Defined in: [calendar/calendar.ts:261](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L261) + +#### Parameters + +##### resources + +`TResource`[] | `null` + +#### Returns + +`void` + +#### Inherited from + +```ts +CalendarActions.setResources +``` + +*** + +### undo() + +```ts +undo: () => void; +``` + +Defined in: [calendar/calendar.ts:209](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L209) + +Reverts the last mutating action (commitAdd, commitUpdate, removeEvent). + +#### Returns + +`void` + +#### Inherited from + +```ts +CalendarActions.undo +``` + +*** + +### validateEventDependencies() + +```ts +validateEventDependencies: (event, dependsOn) => object; +``` + +Defined in: [calendar/calendar.ts:230](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L230) + +Validates if placing an event with a specific start time satisfies all dependency constraints. + +#### Parameters + +##### event + +###### end + +`string` + +###### id? + +`string` + +###### start + +`string` + +###### title + +`string` + +##### dependsOn + +[`EventDependency`](EventDependency.md)[] + +#### Returns + +`object` + +##### error? + +```ts +optional error: ResizeError; +``` + +##### valid + +```ts +valid: boolean; +``` + +#### Inherited from + +```ts +CalendarActions.validateEventDependencies +``` + +*** + +### validateEventPlacement() + +```ts +validateEventPlacement: (event) => object; +``` + +Defined in: [calendar/calendar.ts:255](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L255) + +Validates whether a new event (not yet added to the calendar) can be +placed at the given time slot without violating resource availability. +Use this for standalone validation before manually committing events. + +#### Parameters + +##### event + +###### end + +`string` + +###### resources? + +(`string` \| `TResource`)[] + +###### start + +`string` + +###### title + +`string` + +#### Returns + +`object` + +##### blocked + +```ts +blocked: boolean; +``` + +##### message? + +```ts +optional message: string; +``` + +#### Inherited from + +```ts +CalendarActions.validateEventPlacement +``` + +*** + +### validateMove() + +```ts +validateMove: (eventId, newStart, newEnd, newResources?, newConsumption?) => object; +``` + +Defined in: [calendar/calendar.ts:220](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L220) + +Checks whether moving `eventId` to `[newStart, newEnd]` — and cascading +all finish-to-start dependents — would violate any resource availability. + +#### Parameters + +##### eventId + +`string` + +##### newStart + +`string` + +##### newEnd + +`string` + +##### newResources? + +(`string` \| `TResource`)[] + +##### newConsumption? + +`number`[] + +#### Returns + +`object` + +##### blocked + +```ts +blocked: boolean; +``` + +##### blockedEventTitle? + +```ts +optional blockedEventTitle: string; +``` + +##### message? + +```ts +optional message: string; +``` + +#### Inherited from + +```ts +CalendarActions.validateMove +``` + +*** + +### viewMode + +```ts +viewMode: ViewMode; +``` + +Defined in: [calendar/calendar.ts:272](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L272) + +The current view mode of the calendar. + +#### Inherited from + +```ts +ConvertTemporalToString.viewMode +``` diff --git a/docs/reference/interfaces/CalendarCoreOptions.md b/docs/reference/interfaces/CalendarCoreOptions.md new file mode 100644 index 00000000..ed139463 --- /dev/null +++ b/docs/reference/interfaces/CalendarCoreOptions.md @@ -0,0 +1,210 @@ +--- +id: CalendarCoreOptions +title: CalendarCoreOptions +--- + +# Interface: CalendarCoreOptions\ + +Defined in: [calendar/calendar.ts:53](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L53) + +Configuration options for initializing a CalendarCore instance, allowing customization +of events, locale, time zone, and the calendar system. + +## Extends + +- [`DateCoreOptions`](DateCoreOptions.md) + +## Type Parameters + +### TResource + +`TResource` *extends* [`Resource`](Resource.md) + +### TEvent + +`TEvent` *extends* [`Event`](Event.md)\<`TResource`\> + +Specifies the event type, extending a base Event type. + +## Properties + +### calendar? + +```ts +optional calendar: CalendarLike; +``` + +Defined in: [calendar/date-core.ts:60](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L60) + +Optional calendar system to be used. + +#### Inherited from + +[`DateCoreOptions`](DateCoreOptions.md).[`calendar`](DateCoreOptions.md#calendar) + +*** + +### dateFormatter? + +```ts +optional dateFormatter: DateTimeFormat; +``` + +Defined in: [calendar/date-core.ts:64](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L64) + +Optional date formatter. + +#### Inherited from + +[`DateCoreOptions`](DateCoreOptions.md).[`dateFormatter`](DateCoreOptions.md#dateformatter) + +*** + +### dateTimeFormatter? + +```ts +optional dateTimeFormatter: DateTimeFormat; +``` + +Defined in: [calendar/date-core.ts:68](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L68) + +Optional date time formatter. + +#### Inherited from + +[`DateCoreOptions`](DateCoreOptions.md).[`dateTimeFormatter`](DateCoreOptions.md#datetimeformatter) + +*** + +### events? + +```ts +optional events: TEvent[] | null; +``` + +Defined in: [calendar/calendar.ts:58](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L58) + +An optional array of events to be handled by the calendar. + +*** + +### fetchEvents()? + +```ts +optional fetchEvents: (range) => Promise; +``` + +Defined in: [calendar/calendar.ts:67](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L67) + +Optional async callback for lazy/on-demand event loading. +Called whenever the current viewport window is not yet fully loaded. +The returned events are merged into the internal indices automatically. +When omitted the calendar operates in fully-eager mode (no change in behaviour). + +#### Parameters + +##### range + +###### end + +`string` + +###### start + +`string` + +#### Returns + +`Promise`\<`TEvent`[]\> + +*** + +### locale? + +```ts +optional locale: string; +``` + +Defined in: [calendar/date-core.ts:56](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L56) + +Optional locale for date formatting. Uses a BCP 47 language tag. + +#### Inherited from + +[`DateCoreOptions`](DateCoreOptions.md).[`locale`](DateCoreOptions.md#locale) + +*** + +### range? + +```ts +optional range: DateRange; +``` + +Defined in: [calendar/date-core.ts:62](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L62) + +Optional range of dates to be used. + +#### Inherited from + +[`DateCoreOptions`](DateCoreOptions.md).[`range`](DateCoreOptions.md#range) + +*** + +### resources? + +```ts +optional resources: TResource[] | null; +``` + +Defined in: [calendar/calendar.ts:60](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L60) + +Optional resources to be used in the calendar. + +*** + +### timeFormatter? + +```ts +optional timeFormatter: DateTimeFormat; +``` + +Defined in: [calendar/date-core.ts:66](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L66) + +Optional time formatter. + +#### Inherited from + +[`DateCoreOptions`](DateCoreOptions.md).[`timeFormatter`](DateCoreOptions.md#timeformatter) + +*** + +### timeZone? + +```ts +optional timeZone: TimeZoneLike; +``` + +Defined in: [calendar/date-core.ts:58](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L58) + +Optional time zone specification. + +#### Inherited from + +[`DateCoreOptions`](DateCoreOptions.md).[`timeZone`](DateCoreOptions.md#timezone) + +*** + +### viewMode + +```ts +viewMode: ViewMode; +``` + +Defined in: [calendar/date-core.ts:54](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L54) + +The initial view mode configuration. + +#### Inherited from + +[`DateCoreOptions`](DateCoreOptions.md).[`viewMode`](DateCoreOptions.md#viewmode) diff --git a/docs/reference/interfaces/CalendarStore.md b/docs/reference/interfaces/CalendarStore.md new file mode 100644 index 00000000..23baa023 --- /dev/null +++ b/docs/reference/interfaces/CalendarStore.md @@ -0,0 +1,60 @@ +--- +id: CalendarStore +title: CalendarStore +--- + +# Interface: CalendarStore + +Defined in: [calendar/types.ts:174](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L174) + +## Properties + +### activeDate + +```ts +activeDate: PlainDate; +``` + +Defined in: [calendar/types.ts:176](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L176) + +*** + +### currentPeriod + +```ts +currentPeriod: PlainDate; +``` + +Defined in: [calendar/types.ts:175](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L175) + +*** + +### eventsVersion + +```ts +eventsVersion: number; +``` + +Defined in: [calendar/types.ts:178](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L178) + +*** + +### isPending + +```ts +isPending: boolean; +``` + +Defined in: [calendar/types.ts:180](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L180) + +True while an async fetchEvents call is in-flight for the current viewport. + +*** + +### viewMode + +```ts +viewMode: ViewMode; +``` + +Defined in: [calendar/types.ts:177](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L177) diff --git a/docs/reference/interfaces/CeilOptions.md b/docs/reference/interfaces/CeilOptions.md new file mode 100644 index 00000000..c37d41aa --- /dev/null +++ b/docs/reference/interfaces/CeilOptions.md @@ -0,0 +1,70 @@ +--- +id: CeilOptions +title: CeilOptions +--- + +# Interface: CeilOptions + +Defined in: [date/ceil/ceil.ts:14](https://github.com/TanStack/time/blob/main/packages/time/src/date/ceil/ceil.ts#L14) + +## Extends + +- `DateOperationOptions` + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +```ts +DateOperationOptions.calendar +``` + +*** + +### returnFormat? + +```ts +optional returnFormat: ReturnFormat; +``` + +Defined in: [date/withDateOperation/withDateOperation.ts:9](https://github.com/TanStack/time/blob/main/packages/time/src/date/withDateOperation/withDateOperation.ts#L9) + +#### Inherited from + +```ts +DateOperationOptions.returnFormat +``` + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +```ts +DateOperationOptions.timeZone +``` + +*** + +### unit + +```ts +unit: CeilUnit; +``` + +Defined in: [date/ceil/ceil.ts:15](https://github.com/TanStack/time/blob/main/packages/time/src/date/ceil/ceil.ts#L15) diff --git a/docs/reference/interfaces/ClampOptions.md b/docs/reference/interfaces/ClampOptions.md new file mode 100644 index 00000000..72e7b86e --- /dev/null +++ b/docs/reference/interfaces/ClampOptions.md @@ -0,0 +1,50 @@ +--- +id: ClampOptions +title: ClampOptions +--- + +# Interface: ClampOptions + +Defined in: [date/clamp/clamp.ts:6](https://github.com/TanStack/time/blob/main/packages/time/src/date/clamp/clamp.ts#L6) + +## Extends + +- [`DateOptions`](DateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`calendar`](DateOptions.md#calendar) + +*** + +### range + +```ts +range: Range; +``` + +Defined in: [date/clamp/clamp.ts:7](https://github.com/TanStack/time/blob/main/packages/time/src/date/clamp/clamp.ts#L7) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`timeZone`](DateOptions.md#timezone) diff --git a/docs/reference/interfaces/CountOptions.md b/docs/reference/interfaces/CountOptions.md new file mode 100644 index 00000000..8e8aa244 --- /dev/null +++ b/docs/reference/interfaces/CountOptions.md @@ -0,0 +1,50 @@ +--- +id: CountOptions +title: CountOptions +--- + +# Interface: CountOptions + +Defined in: [date/count/count.ts:15](https://github.com/TanStack/time/blob/main/packages/time/src/date/count/count.ts#L15) + +## Extends + +- [`DateOptions`](DateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`calendar`](DateOptions.md#calendar) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`timeZone`](DateOptions.md#timezone) + +*** + +### unit + +```ts +unit: CountUnit; +``` + +Defined in: [date/count/count.ts:16](https://github.com/TanStack/time/blob/main/packages/time/src/date/count/count.ts#L16) diff --git a/docs/reference/interfaces/DateCoreOptions.md b/docs/reference/interfaces/DateCoreOptions.md new file mode 100644 index 00000000..267fd3e3 --- /dev/null +++ b/docs/reference/interfaces/DateCoreOptions.md @@ -0,0 +1,110 @@ +--- +id: DateCoreOptions +title: DateCoreOptions +--- + +# Interface: DateCoreOptions + +Defined in: [calendar/date-core.ts:52](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L52) + +Base options interface for date-related core classes. + +## Extended by + +- [`CalendarCoreOptions`](CalendarCoreOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: CalendarLike; +``` + +Defined in: [calendar/date-core.ts:60](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L60) + +Optional calendar system to be used. + +*** + +### dateFormatter? + +```ts +optional dateFormatter: DateTimeFormat; +``` + +Defined in: [calendar/date-core.ts:64](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L64) + +Optional date formatter. + +*** + +### dateTimeFormatter? + +```ts +optional dateTimeFormatter: DateTimeFormat; +``` + +Defined in: [calendar/date-core.ts:68](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L68) + +Optional date time formatter. + +*** + +### locale? + +```ts +optional locale: string; +``` + +Defined in: [calendar/date-core.ts:56](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L56) + +Optional locale for date formatting. Uses a BCP 47 language tag. + +*** + +### range? + +```ts +optional range: DateRange; +``` + +Defined in: [calendar/date-core.ts:62](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L62) + +Optional range of dates to be used. + +*** + +### timeFormatter? + +```ts +optional timeFormatter: DateTimeFormat; +``` + +Defined in: [calendar/date-core.ts:66](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L66) + +Optional time formatter. + +*** + +### timeZone? + +```ts +optional timeZone: TimeZoneLike; +``` + +Defined in: [calendar/date-core.ts:58](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L58) + +Optional time zone specification. + +*** + +### viewMode + +```ts +viewMode: ViewMode; +``` + +Defined in: [calendar/date-core.ts:54](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L54) + +The initial view mode configuration. diff --git a/docs/reference/interfaces/DateOptions.md b/docs/reference/interfaces/DateOptions.md new file mode 100644 index 00000000..663e6438 --- /dev/null +++ b/docs/reference/interfaces/DateOptions.md @@ -0,0 +1,53 @@ +--- +id: DateOptions +title: DateOptions +--- + +# Interface: DateOptions + +Defined in: [date/types.ts:10](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L10) + +## Extended by + +- [`SinceOptions`](SinceOptions.md) +- [`UntilOptions`](UntilOptions.md) +- [`EqualsOptions`](EqualsOptions.md) +- [`IsLeapYearOptions`](IsLeapYearOptions.md) +- [`IsWeekendOptions`](IsWeekendOptions.md) +- [`ClampOptions`](ClampOptions.md) +- [`CountOptions`](CountOptions.md) +- [`MinOptions`](MinOptions.md) +- [`MaxOptions`](MaxOptions.md) +- [`IsPastOptions`](IsPastOptions.md) +- [`IsFutureOptions`](IsFutureOptions.md) +- [`FromUnixTimeOptions`](FromUnixTimeOptions.md) +- [`GetUnixTimeOptions`](GetUnixTimeOptions.md) +- [`GetDayOfYearOptions`](GetDayOfYearOptions.md) +- [`GetWeekOptions`](GetWeekOptions.md) +- [`IsBeforeOptions`](IsBeforeOptions.md) +- [`IsAfterOptions`](IsAfterOptions.md) +- [`IsSameOrBeforeOptions`](IsSameOrBeforeOptions.md) +- [`IsSameOrAfterOptions`](IsSameOrAfterOptions.md) +- [`IsBetweenOptions`](IsBetweenOptions.md) +- [`IntersectsOptions`](IntersectsOptions.md) +- [`FormatDateOptions`](FormatDateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) diff --git a/docs/reference/interfaces/DateRange.md b/docs/reference/interfaces/DateRange.md new file mode 100644 index 00000000..b62917bc --- /dev/null +++ b/docs/reference/interfaces/DateRange.md @@ -0,0 +1,28 @@ +--- +id: DateRange +title: DateRange +--- + +# Interface: DateRange + +Defined in: [calendar/types.ts:152](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L152) + +## Properties + +### end + +```ts +end: DateInput | null; +``` + +Defined in: [calendar/types.ts:154](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L154) + +*** + +### start + +```ts +start: DateInput | null; +``` + +Defined in: [calendar/types.ts:153](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L153) diff --git a/docs/reference/interfaces/EndOfOptions.md b/docs/reference/interfaces/EndOfOptions.md new file mode 100644 index 00000000..7f3c282c --- /dev/null +++ b/docs/reference/interfaces/EndOfOptions.md @@ -0,0 +1,70 @@ +--- +id: EndOfOptions +title: EndOfOptions +--- + +# Interface: EndOfOptions + +Defined in: [date/endOf/endOf.ts:15](https://github.com/TanStack/time/blob/main/packages/time/src/date/endOf/endOf.ts#L15) + +## Extends + +- `DateOperationOptions` + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +```ts +DateOperationOptions.calendar +``` + +*** + +### returnFormat? + +```ts +optional returnFormat: ReturnFormat; +``` + +Defined in: [date/withDateOperation/withDateOperation.ts:9](https://github.com/TanStack/time/blob/main/packages/time/src/date/withDateOperation/withDateOperation.ts#L9) + +#### Inherited from + +```ts +DateOperationOptions.returnFormat +``` + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +```ts +DateOperationOptions.timeZone +``` + +*** + +### unit + +```ts +unit: EndOfUnit; +``` + +Defined in: [date/endOf/endOf.ts:16](https://github.com/TanStack/time/blob/main/packages/time/src/date/endOf/endOf.ts#L16) diff --git a/docs/reference/interfaces/EqualsOptions.md b/docs/reference/interfaces/EqualsOptions.md new file mode 100644 index 00000000..530e281b --- /dev/null +++ b/docs/reference/interfaces/EqualsOptions.md @@ -0,0 +1,40 @@ +--- +id: EqualsOptions +title: EqualsOptions +--- + +# Interface: EqualsOptions + +Defined in: [date/equals/equals.ts:16](https://github.com/TanStack/time/blob/main/packages/time/src/date/equals/equals.ts#L16) + +## Extends + +- [`DateOptions`](DateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`calendar`](DateOptions.md#calendar) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`timeZone`](DateOptions.md#timezone) diff --git a/docs/reference/interfaces/Event.md b/docs/reference/interfaces/Event.md new file mode 100644 index 00000000..0933da7a --- /dev/null +++ b/docs/reference/interfaces/Event.md @@ -0,0 +1,177 @@ +--- +id: Event +title: Event +--- + +# Interface: Event\ + +Defined in: [calendar/types.ts:101](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L101) + +## Type Parameters + +### TResource + +`TResource` *extends* [`Resource`](Resource.md) = [`Resource`](Resource.md) + +## Properties + +### \_occurrenceIndex? + +```ts +optional _occurrenceIndex: number; +``` + +Defined in: [calendar/types.ts:132](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L132) + +0-based index of this occurrence within the recurring series. + +*** + +### \_occurrenceOriginalStart? + +```ts +optional _occurrenceOriginalStart: string; +``` + +Defined in: [calendar/types.ts:134](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L134) + +Original occurrence start before EXDATE/override changes. + +*** + +### \_originalEnd? + +```ts +optional _originalEnd: string; +``` + +Defined in: [calendar/types.ts:125](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L125) + +Original end time before splitting (only set on split segments of multi-day events) + +*** + +### \_originalStart? + +```ts +optional _originalStart: string; +``` + +Defined in: [calendar/types.ts:123](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L123) + +Original start time before splitting (only set on split segments of multi-day events) + +*** + +### \_recurringMasterId? + +```ts +optional _recurringMasterId: string; +``` + +Defined in: [calendar/types.ts:130](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L130) + +ID of the master recurring event this occurrence was generated from. +Only present on ephemeral occurrence instances (index > 0). + +*** + +### allDay? + +```ts +optional allDay: boolean; +``` + +Defined in: [calendar/types.ts:121](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L121) + +When true, event spans full day(s) and is rendered in the all-day strip +separately from timed events. `start` and `end` are still ISO datetime strings; +for an all-day event use the day's start (00:00:00) and the inclusive day's +end (23:59:59) — or any time within those days. Multi-day all-day events +are split per-day like regular events. + +*** + +### consumption? + +```ts +optional consumption: number[]; +``` + +Defined in: [calendar/types.ts:107](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L107) + +*** + +### dependsOn? + +```ts +optional dependsOn: EventDependency[]; +``` + +Defined in: [calendar/types.ts:111](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L111) + +Dependency links to other events this event is constrained by. +Each link has an `id` (predecessor event) and a `type` (FS/SS/FF/SF). +When a predecessor's relevant anchor shifts, this event shifts by the same delta. + +*** + +### end + +```ts +end: EventDateTimeInput; +``` + +Defined in: [calendar/types.ts:104](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L104) + +*** + +### id + +```ts +id: string; +``` + +Defined in: [calendar/types.ts:102](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L102) + +*** + +### recurrence? + +```ts +optional recurrence: RecurrenceRule; +``` + +Defined in: [calendar/types.ts:113](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L113) + +Defines how and when this event repeats. + +*** + +### resources? + +```ts +optional resources: (string | TResource)[]; +``` + +Defined in: [calendar/types.ts:106](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L106) + +*** + +### start + +```ts +start: EventDateTimeInput; +``` + +Defined in: [calendar/types.ts:103](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L103) + +*** + +### title + +```ts +title: string; +``` + +Defined in: [calendar/types.ts:105](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L105) diff --git a/docs/reference/interfaces/EventDependency.md b/docs/reference/interfaces/EventDependency.md new file mode 100644 index 00000000..b85574f1 --- /dev/null +++ b/docs/reference/interfaces/EventDependency.md @@ -0,0 +1,30 @@ +--- +id: EventDependency +title: EventDependency +--- + +# Interface: EventDependency + +Defined in: [calendar/types.ts:13](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L13) + +A single dependency from one event to another. + +## Properties + +### id + +```ts +id: string; +``` + +Defined in: [calendar/types.ts:14](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L14) + +*** + +### type + +```ts +type: DependencyType; +``` + +Defined in: [calendar/types.ts:15](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L15) diff --git a/docs/reference/interfaces/EventTimeRange.md b/docs/reference/interfaces/EventTimeRange.md new file mode 100644 index 00000000..1f0354da --- /dev/null +++ b/docs/reference/interfaces/EventTimeRange.md @@ -0,0 +1,38 @@ +--- +id: EventTimeRange +title: EventTimeRange +--- + +# Interface: EventTimeRange + +Defined in: [calendar/getResizeProps.ts:504](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L504) + +## Properties + +### end + +```ts +end: string; +``` + +Defined in: [calendar/getResizeProps.ts:506](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L506) + +*** + +### isMultiDay + +```ts +isMultiDay: boolean; +``` + +Defined in: [calendar/getResizeProps.ts:507](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L507) + +*** + +### start + +```ts +start: string; +``` + +Defined in: [calendar/getResizeProps.ts:505](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L505) diff --git a/docs/reference/interfaces/FormatDateOptions.md b/docs/reference/interfaces/FormatDateOptions.md new file mode 100644 index 00000000..cb4727cd --- /dev/null +++ b/docs/reference/interfaces/FormatDateOptions.md @@ -0,0 +1,74 @@ +--- +id: FormatDateOptions +title: FormatDateOptions +--- + +# Interface: FormatDateOptions + +Defined in: [date/format/format.ts:16](https://github.com/TanStack/time/blob/main/packages/time/src/date/format/format.ts#L16) + +## Extends + +- [`DateOptions`](DateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`calendar`](DateOptions.md#calendar) + +*** + +### locale? + +```ts +optional locale: string | string[] | Locale | Locale[]; +``` + +Defined in: [date/format/format.ts:18](https://github.com/TanStack/time/blob/main/packages/time/src/date/format/format.ts#L18) + +*** + +### options? + +```ts +optional options: + | string + | DateFormatterOptions + | TimeFormatterOptions + | DateTimeFormatterOptions; +``` + +Defined in: [date/format/format.ts:19](https://github.com/TanStack/time/blob/main/packages/time/src/date/format/format.ts#L19) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`timeZone`](DateOptions.md#timezone) + +*** + +### type? + +```ts +optional type: FormatType; +``` + +Defined in: [date/format/format.ts:17](https://github.com/TanStack/time/blob/main/packages/time/src/date/format/format.ts#L17) diff --git a/docs/reference/interfaces/FormatEventTimeOptions.md b/docs/reference/interfaces/FormatEventTimeOptions.md new file mode 100644 index 00000000..779f7ff8 --- /dev/null +++ b/docs/reference/interfaces/FormatEventTimeOptions.md @@ -0,0 +1,32 @@ +--- +id: FormatEventTimeOptions +title: FormatEventTimeOptions +--- + +# Interface: FormatEventTimeOptions + +Defined in: [calendar/getResizeProps.ts:539](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L539) + +## Properties + +### alwaysShowDate? + +```ts +optional alwaysShowDate: boolean; +``` + +Defined in: [calendar/getResizeProps.ts:543](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L543) + +Whether to include date for single-day events + +*** + +### locale? + +```ts +optional locale: string; +``` + +Defined in: [calendar/getResizeProps.ts:541](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L541) + +Locale for formatting (e.g., 'en-US') diff --git a/docs/reference/interfaces/FormattedEventTime.md b/docs/reference/interfaces/FormattedEventTime.md new file mode 100644 index 00000000..b28aac93 --- /dev/null +++ b/docs/reference/interfaces/FormattedEventTime.md @@ -0,0 +1,56 @@ +--- +id: FormattedEventTime +title: FormattedEventTime +--- + +# Interface: FormattedEventTime + +Defined in: [calendar/getResizeProps.ts:546](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L546) + +## Properties + +### endFormatted + +```ts +endFormatted: string; +``` + +Defined in: [calendar/getResizeProps.ts:550](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L550) + +Formatted end string + +*** + +### isMultiDay + +```ts +isMultiDay: boolean; +``` + +Defined in: [calendar/getResizeProps.ts:554](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L554) + +Whether this is a multi-day event + +*** + +### rangeFormatted + +```ts +rangeFormatted: string; +``` + +Defined in: [calendar/getResizeProps.ts:552](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L552) + +Full formatted range string + +*** + +### startFormatted + +```ts +startFormatted: string; +``` + +Defined in: [calendar/getResizeProps.ts:548](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L548) + +Formatted start string diff --git a/docs/reference/interfaces/FromUnixTimeOptions.md b/docs/reference/interfaces/FromUnixTimeOptions.md new file mode 100644 index 00000000..13184e10 --- /dev/null +++ b/docs/reference/interfaces/FromUnixTimeOptions.md @@ -0,0 +1,40 @@ +--- +id: FromUnixTimeOptions +title: FromUnixTimeOptions +--- + +# Interface: FromUnixTimeOptions + +Defined in: [date/fromUnixTime/fromUnixTime.ts:6](https://github.com/TanStack/time/blob/main/packages/time/src/date/fromUnixTime/fromUnixTime.ts#L6) + +## Extends + +- [`DateOptions`](DateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`calendar`](DateOptions.md#calendar) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`timeZone`](DateOptions.md#timezone) diff --git a/docs/reference/interfaces/GetDayOfYearOptions.md b/docs/reference/interfaces/GetDayOfYearOptions.md new file mode 100644 index 00000000..57c3c561 --- /dev/null +++ b/docs/reference/interfaces/GetDayOfYearOptions.md @@ -0,0 +1,40 @@ +--- +id: GetDayOfYearOptions +title: GetDayOfYearOptions +--- + +# Interface: GetDayOfYearOptions + +Defined in: [date/getDayOfYear/getDayOfYear.ts:5](https://github.com/TanStack/time/blob/main/packages/time/src/date/getDayOfYear/getDayOfYear.ts#L5) + +## Extends + +- [`DateOptions`](DateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`calendar`](DateOptions.md#calendar) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`timeZone`](DateOptions.md#timezone) diff --git a/docs/reference/interfaces/GetUnixTimeOptions.md b/docs/reference/interfaces/GetUnixTimeOptions.md new file mode 100644 index 00000000..874b433b --- /dev/null +++ b/docs/reference/interfaces/GetUnixTimeOptions.md @@ -0,0 +1,40 @@ +--- +id: GetUnixTimeOptions +title: GetUnixTimeOptions +--- + +# Interface: GetUnixTimeOptions + +Defined in: [date/getUnixTime/getUnixTime.ts:5](https://github.com/TanStack/time/blob/main/packages/time/src/date/getUnixTime/getUnixTime.ts#L5) + +## Extends + +- [`DateOptions`](DateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`calendar`](DateOptions.md#calendar) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`timeZone`](DateOptions.md#timezone) diff --git a/docs/reference/interfaces/GetWeekOptions.md b/docs/reference/interfaces/GetWeekOptions.md new file mode 100644 index 00000000..fa1d9bdc --- /dev/null +++ b/docs/reference/interfaces/GetWeekOptions.md @@ -0,0 +1,40 @@ +--- +id: GetWeekOptions +title: GetWeekOptions +--- + +# Interface: GetWeekOptions + +Defined in: [date/getWeek/getWeek.ts:5](https://github.com/TanStack/time/blob/main/packages/time/src/date/getWeek/getWeek.ts#L5) + +## Extends + +- [`DateOptions`](DateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`calendar`](DateOptions.md#calendar) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`timeZone`](DateOptions.md#timezone) diff --git a/docs/reference/interfaces/GhostPreviewOptions.md b/docs/reference/interfaces/GhostPreviewOptions.md new file mode 100644 index 00000000..5e859e96 --- /dev/null +++ b/docs/reference/interfaces/GhostPreviewOptions.md @@ -0,0 +1,44 @@ +--- +id: GhostPreviewOptions +title: GhostPreviewOptions +--- + +# Interface: GhostPreviewOptions + +Defined in: [calendar/getResizeProps.ts:369](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L369) + +## Properties + +### dayDate + +```ts +dayDate: string; +``` + +Defined in: [calendar/getResizeProps.ts:371](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L371) + +The date string of the day being rendered (YYYY-MM-DD) + +*** + +### previewEnd + +```ts +previewEnd: string; +``` + +Defined in: [calendar/getResizeProps.ts:375](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L375) + +The preview end during resize + +*** + +### previewStart + +```ts +previewStart: string; +``` + +Defined in: [calendar/getResizeProps.ts:373](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L373) + +The preview start during resize diff --git a/docs/reference/interfaces/IntersectsOptions.md b/docs/reference/interfaces/IntersectsOptions.md new file mode 100644 index 00000000..431b4865 --- /dev/null +++ b/docs/reference/interfaces/IntersectsOptions.md @@ -0,0 +1,50 @@ +--- +id: IntersectsOptions +title: IntersectsOptions +--- + +# Interface: IntersectsOptions + +Defined in: [date/intersects/intersects.ts:6](https://github.com/TanStack/time/blob/main/packages/time/src/date/intersects/intersects.ts#L6) + +## Extends + +- [`DateOptions`](DateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`calendar`](DateOptions.md#calendar) + +*** + +### range + +```ts +range: Range; +``` + +Defined in: [date/intersects/intersects.ts:7](https://github.com/TanStack/time/blob/main/packages/time/src/date/intersects/intersects.ts#L7) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`timeZone`](DateOptions.md#timezone) diff --git a/docs/reference/interfaces/IsAfterOptions.md b/docs/reference/interfaces/IsAfterOptions.md new file mode 100644 index 00000000..fb772548 --- /dev/null +++ b/docs/reference/interfaces/IsAfterOptions.md @@ -0,0 +1,40 @@ +--- +id: IsAfterOptions +title: IsAfterOptions +--- + +# Interface: IsAfterOptions + +Defined in: [date/isAfter/isAfter.ts:6](https://github.com/TanStack/time/blob/main/packages/time/src/date/isAfter/isAfter.ts#L6) + +## Extends + +- [`DateOptions`](DateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`calendar`](DateOptions.md#calendar) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`timeZone`](DateOptions.md#timezone) diff --git a/docs/reference/interfaces/IsBeforeOptions.md b/docs/reference/interfaces/IsBeforeOptions.md new file mode 100644 index 00000000..3c06573c --- /dev/null +++ b/docs/reference/interfaces/IsBeforeOptions.md @@ -0,0 +1,40 @@ +--- +id: IsBeforeOptions +title: IsBeforeOptions +--- + +# Interface: IsBeforeOptions + +Defined in: [date/isBefore/isBefore.ts:6](https://github.com/TanStack/time/blob/main/packages/time/src/date/isBefore/isBefore.ts#L6) + +## Extends + +- [`DateOptions`](DateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`calendar`](DateOptions.md#calendar) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`timeZone`](DateOptions.md#timezone) diff --git a/docs/reference/interfaces/IsBetweenOptions.md b/docs/reference/interfaces/IsBetweenOptions.md new file mode 100644 index 00000000..48e5ca62 --- /dev/null +++ b/docs/reference/interfaces/IsBetweenOptions.md @@ -0,0 +1,60 @@ +--- +id: IsBetweenOptions +title: IsBetweenOptions +--- + +# Interface: IsBetweenOptions + +Defined in: [date/isBetween/isBetween.ts:6](https://github.com/TanStack/time/blob/main/packages/time/src/date/isBetween/isBetween.ts#L6) + +## Extends + +- [`DateOptions`](DateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`calendar`](DateOptions.md#calendar) + +*** + +### inclusive? + +```ts +optional inclusive: boolean | "start" | "end"; +``` + +Defined in: [date/isBetween/isBetween.ts:7](https://github.com/TanStack/time/blob/main/packages/time/src/date/isBetween/isBetween.ts#L7) + +*** + +### range + +```ts +range: Range; +``` + +Defined in: [date/isBetween/isBetween.ts:8](https://github.com/TanStack/time/blob/main/packages/time/src/date/isBetween/isBetween.ts#L8) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`timeZone`](DateOptions.md#timezone) diff --git a/docs/reference/interfaces/IsFutureOptions.md b/docs/reference/interfaces/IsFutureOptions.md new file mode 100644 index 00000000..d777d20d --- /dev/null +++ b/docs/reference/interfaces/IsFutureOptions.md @@ -0,0 +1,40 @@ +--- +id: IsFutureOptions +title: IsFutureOptions +--- + +# Interface: IsFutureOptions + +Defined in: [date/isFuture/isFuture.ts:6](https://github.com/TanStack/time/blob/main/packages/time/src/date/isFuture/isFuture.ts#L6) + +## Extends + +- [`DateOptions`](DateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`calendar`](DateOptions.md#calendar) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`timeZone`](DateOptions.md#timezone) diff --git a/docs/reference/interfaces/IsLeapYearOptions.md b/docs/reference/interfaces/IsLeapYearOptions.md new file mode 100644 index 00000000..dcdcc9f2 --- /dev/null +++ b/docs/reference/interfaces/IsLeapYearOptions.md @@ -0,0 +1,40 @@ +--- +id: IsLeapYearOptions +title: IsLeapYearOptions +--- + +# Interface: IsLeapYearOptions + +Defined in: [date/isLeapYear/isLeapYear.ts:5](https://github.com/TanStack/time/blob/main/packages/time/src/date/isLeapYear/isLeapYear.ts#L5) + +## Extends + +- [`DateOptions`](DateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`calendar`](DateOptions.md#calendar) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`timeZone`](DateOptions.md#timezone) diff --git a/docs/reference/interfaces/IsPastOptions.md b/docs/reference/interfaces/IsPastOptions.md new file mode 100644 index 00000000..a1ca5159 --- /dev/null +++ b/docs/reference/interfaces/IsPastOptions.md @@ -0,0 +1,40 @@ +--- +id: IsPastOptions +title: IsPastOptions +--- + +# Interface: IsPastOptions + +Defined in: [date/isPast/isPast.ts:6](https://github.com/TanStack/time/blob/main/packages/time/src/date/isPast/isPast.ts#L6) + +## Extends + +- [`DateOptions`](DateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`calendar`](DateOptions.md#calendar) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`timeZone`](DateOptions.md#timezone) diff --git a/docs/reference/interfaces/IsSameOrAfterOptions.md b/docs/reference/interfaces/IsSameOrAfterOptions.md new file mode 100644 index 00000000..92f0e03c --- /dev/null +++ b/docs/reference/interfaces/IsSameOrAfterOptions.md @@ -0,0 +1,50 @@ +--- +id: IsSameOrAfterOptions +title: IsSameOrAfterOptions +--- + +# Interface: IsSameOrAfterOptions + +Defined in: [date/isSameOrAfter/isSameOrAfter.ts:17](https://github.com/TanStack/time/blob/main/packages/time/src/date/isSameOrAfter/isSameOrAfter.ts#L17) + +## Extends + +- [`DateOptions`](DateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`calendar`](DateOptions.md#calendar) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`timeZone`](DateOptions.md#timezone) + +*** + +### unit + +```ts +unit: IsSameOrAfterUnit; +``` + +Defined in: [date/isSameOrAfter/isSameOrAfter.ts:18](https://github.com/TanStack/time/blob/main/packages/time/src/date/isSameOrAfter/isSameOrAfter.ts#L18) diff --git a/docs/reference/interfaces/IsSameOrBeforeOptions.md b/docs/reference/interfaces/IsSameOrBeforeOptions.md new file mode 100644 index 00000000..e818e578 --- /dev/null +++ b/docs/reference/interfaces/IsSameOrBeforeOptions.md @@ -0,0 +1,50 @@ +--- +id: IsSameOrBeforeOptions +title: IsSameOrBeforeOptions +--- + +# Interface: IsSameOrBeforeOptions + +Defined in: [date/isSameOrBefore/isSameOrBefore.ts:17](https://github.com/TanStack/time/blob/main/packages/time/src/date/isSameOrBefore/isSameOrBefore.ts#L17) + +## Extends + +- [`DateOptions`](DateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`calendar`](DateOptions.md#calendar) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`timeZone`](DateOptions.md#timezone) + +*** + +### unit + +```ts +unit: IsSameOrBeforeUnit; +``` + +Defined in: [date/isSameOrBefore/isSameOrBefore.ts:18](https://github.com/TanStack/time/blob/main/packages/time/src/date/isSameOrBefore/isSameOrBefore.ts#L18) diff --git a/docs/reference/interfaces/IsWeekendOptions.md b/docs/reference/interfaces/IsWeekendOptions.md new file mode 100644 index 00000000..f1bc1c23 --- /dev/null +++ b/docs/reference/interfaces/IsWeekendOptions.md @@ -0,0 +1,50 @@ +--- +id: IsWeekendOptions +title: IsWeekendOptions +--- + +# Interface: IsWeekendOptions + +Defined in: [date/isWeekend/isWeekend.ts:6](https://github.com/TanStack/time/blob/main/packages/time/src/date/isWeekend/isWeekend.ts#L6) + +## Extends + +- [`DateOptions`](DateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`calendar`](DateOptions.md#calendar) + +*** + +### locale? + +```ts +optional locale: string; +``` + +Defined in: [date/isWeekend/isWeekend.ts:7](https://github.com/TanStack/time/blob/main/packages/time/src/date/isWeekend/isWeekend.ts#L7) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`timeZone`](DateOptions.md#timezone) diff --git a/docs/reference/interfaces/MaxOptions.md b/docs/reference/interfaces/MaxOptions.md new file mode 100644 index 00000000..5aa64cec --- /dev/null +++ b/docs/reference/interfaces/MaxOptions.md @@ -0,0 +1,40 @@ +--- +id: MaxOptions +title: MaxOptions +--- + +# Interface: MaxOptions + +Defined in: [date/max/max.ts:7](https://github.com/TanStack/time/blob/main/packages/time/src/date/max/max.ts#L7) + +## Extends + +- [`DateOptions`](DateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`calendar`](DateOptions.md#calendar) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`timeZone`](DateOptions.md#timezone) diff --git a/docs/reference/interfaces/MinOptions.md b/docs/reference/interfaces/MinOptions.md new file mode 100644 index 00000000..f234d2b1 --- /dev/null +++ b/docs/reference/interfaces/MinOptions.md @@ -0,0 +1,40 @@ +--- +id: MinOptions +title: MinOptions +--- + +# Interface: MinOptions + +Defined in: [date/min/min.ts:7](https://github.com/TanStack/time/blob/main/packages/time/src/date/min/min.ts#L7) + +## Extends + +- [`DateOptions`](DateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`calendar`](DateOptions.md#calendar) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`timeZone`](DateOptions.md#timezone) diff --git a/docs/reference/interfaces/ParsedDateCoreOptions.md b/docs/reference/interfaces/ParsedDateCoreOptions.md new file mode 100644 index 00000000..5e694cf3 --- /dev/null +++ b/docs/reference/interfaces/ParsedDateCoreOptions.md @@ -0,0 +1,86 @@ +--- +id: ParsedDateCoreOptions +title: ParsedDateCoreOptions +--- + +# Interface: ParsedDateCoreOptions + +Defined in: [calendar/date-core.ts:71](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L71) + +## Extends + +- `Omit`\<`Required`\<[`DateCoreOptions`](DateCoreOptions.md)\>, `"range"` \| `"dateFormatter"` \| `"timeFormatter"` \| `"dateTimeFormatter"`\> + +## Properties + +### calendar + +```ts +calendar: CalendarLike; +``` + +Defined in: [calendar/date-core.ts:60](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L60) + +Optional calendar system to be used. + +#### Inherited from + +[`CalendarCoreOptions`](CalendarCoreOptions.md).[`calendar`](CalendarCoreOptions.md#calendar) + +*** + +### locale + +```ts +locale: string; +``` + +Defined in: [calendar/date-core.ts:56](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L56) + +Optional locale for date formatting. Uses a BCP 47 language tag. + +#### Inherited from + +[`CalendarCoreOptions`](CalendarCoreOptions.md).[`locale`](CalendarCoreOptions.md#locale) + +*** + +### range + +```ts +range: ParsedDateRange; +``` + +Defined in: [calendar/date-core.ts:75](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L75) + +*** + +### timeZone + +```ts +timeZone: TimeZoneLike; +``` + +Defined in: [calendar/date-core.ts:58](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L58) + +Optional time zone specification. + +#### Inherited from + +[`CalendarCoreOptions`](CalendarCoreOptions.md).[`timeZone`](CalendarCoreOptions.md#timezone) + +*** + +### viewMode + +```ts +viewMode: ViewMode; +``` + +Defined in: [calendar/date-core.ts:54](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/date-core.ts#L54) + +The initial view mode configuration. + +#### Inherited from + +[`CalendarCoreOptions`](CalendarCoreOptions.md).[`viewMode`](CalendarCoreOptions.md#viewmode) diff --git a/docs/reference/interfaces/PositionStyle.md b/docs/reference/interfaces/PositionStyle.md new file mode 100644 index 00000000..3c2700fb --- /dev/null +++ b/docs/reference/interfaces/PositionStyle.md @@ -0,0 +1,30 @@ +--- +id: PositionStyle +title: PositionStyle +--- + +# Interface: PositionStyle + +Defined in: [calendar/getResizeProps.ts:266](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L266) + +Style for positioned elements (events, ghosts) + +## Properties + +### height + +```ts +height: string; +``` + +Defined in: [calendar/getResizeProps.ts:268](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L268) + +*** + +### top + +```ts +top: string; +``` + +Defined in: [calendar/getResizeProps.ts:267](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L267) diff --git a/docs/reference/interfaces/Range.md b/docs/reference/interfaces/Range.md new file mode 100644 index 00000000..47d83f53 --- /dev/null +++ b/docs/reference/interfaces/Range.md @@ -0,0 +1,28 @@ +--- +id: Range +title: Range +--- + +# Interface: Range + +Defined in: [date/types.ts:17](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L17) + +## Properties + +### end + +```ts +end: DateInput; +``` + +Defined in: [date/types.ts:19](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L19) + +*** + +### start + +```ts +start: DateInput; +``` + +Defined in: [date/types.ts:18](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L18) diff --git a/docs/reference/interfaces/RangeOptions.md b/docs/reference/interfaces/RangeOptions.md new file mode 100644 index 00000000..86eaaf67 --- /dev/null +++ b/docs/reference/interfaces/RangeOptions.md @@ -0,0 +1,90 @@ +--- +id: RangeOptions +title: RangeOptions +--- + +# Interface: RangeOptions + +Defined in: [date/range/range.ts:7](https://github.com/TanStack/time/blob/main/packages/time/src/date/range/range.ts#L7) + +## Extends + +- `DateOperationOptions` + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +```ts +DateOperationOptions.calendar +``` + +*** + +### end + +```ts +end: DateInput; +``` + +Defined in: [date/range/range.ts:9](https://github.com/TanStack/time/blob/main/packages/time/src/date/range/range.ts#L9) + +*** + +### returnFormat? + +```ts +optional returnFormat: ReturnFormat; +``` + +Defined in: [date/withDateOperation/withDateOperation.ts:9](https://github.com/TanStack/time/blob/main/packages/time/src/date/withDateOperation/withDateOperation.ts#L9) + +#### Inherited from + +```ts +DateOperationOptions.returnFormat +``` + +*** + +### start + +```ts +start: DateInput; +``` + +Defined in: [date/range/range.ts:8](https://github.com/TanStack/time/blob/main/packages/time/src/date/range/range.ts#L8) + +*** + +### step + +```ts +step: DurationLike; +``` + +Defined in: [date/range/range.ts:10](https://github.com/TanStack/time/blob/main/packages/time/src/date/range/range.ts#L10) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +```ts +DateOperationOptions.timeZone +``` diff --git a/docs/reference/interfaces/RecurrenceOverride.md b/docs/reference/interfaces/RecurrenceOverride.md new file mode 100644 index 00000000..be7fa4eb --- /dev/null +++ b/docs/reference/interfaces/RecurrenceOverride.md @@ -0,0 +1,116 @@ +--- +id: RecurrenceOverride +title: RecurrenceOverride +--- + +# Interface: RecurrenceOverride\ + +Defined in: [calendar/types.ts:22](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L22) + +Single-occurrence replacement keyed by the original occurrence start. + +## Type Parameters + +### TResource + +`TResource` *extends* [`Resource`](Resource.md) = [`Resource`](Resource.md) + +## Indexable + +```ts +[key: string]: unknown +``` + +## Properties + +### allDay? + +```ts +optional allDay: boolean; +``` + +Defined in: [calendar/types.ts:33](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L33) + +*** + +### consumption? + +```ts +optional consumption: number[]; +``` + +Defined in: [calendar/types.ts:31](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L31) + +*** + +### dependsOn? + +```ts +optional dependsOn: EventDependency[]; +``` + +Defined in: [calendar/types.ts:32](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L32) + +*** + +### end? + +```ts +optional end: EventDateTimeInput; +``` + +Defined in: [calendar/types.ts:28](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L28) + +*** + +### id? + +```ts +optional id: string; +``` + +Defined in: [calendar/types.ts:26](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L26) + +Optional replacement occurrence id. Defaults to the generated occurrence id. + +*** + +### originalStart + +```ts +originalStart: EventDateTimeInput; +``` + +Defined in: [calendar/types.ts:24](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L24) + +Original occurrence start (RECURRENCE-ID equivalent). + +*** + +### resources? + +```ts +optional resources: (string | TResource)[]; +``` + +Defined in: [calendar/types.ts:30](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L30) + +*** + +### start? + +```ts +optional start: EventDateTimeInput; +``` + +Defined in: [calendar/types.ts:27](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L27) + +*** + +### title? + +```ts +optional title: string; +``` + +Defined in: [calendar/types.ts:29](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L29) diff --git a/docs/reference/interfaces/RecurrenceRule.md b/docs/reference/interfaces/RecurrenceRule.md new file mode 100644 index 00000000..2bd20b68 --- /dev/null +++ b/docs/reference/interfaces/RecurrenceRule.md @@ -0,0 +1,105 @@ +--- +id: RecurrenceRule +title: RecurrenceRule +--- + +# Interface: RecurrenceRule\ + +Defined in: [calendar/types.ts:41](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L41) + +Defines the repetition rule for a recurring event. +Occurrences are expanded automatically by the calendar within the current viewport. + +## Type Parameters + +### TResource + +`TResource` *extends* [`Resource`](Resource.md) = [`Resource`](Resource.md) + +## Properties + +### byWeekday? + +```ts +optional byWeekday: number[]; +``` + +Defined in: [calendar/types.ts:63](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L63) + +For `weekly` frequency: ISO weekdays (1 = Mon … 7 = Sun) to repeat on. +Defaults to the weekday of the original event start. + +*** + +### count? + +```ts +optional count: number; +``` + +Defined in: [calendar/types.ts:58](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L58) + +Maximum total occurrences to generate (including the original). +Only used when `until` is not set. + +*** + +### exDates? + +```ts +optional exDates: EventDateTimeInput[]; +``` + +Defined in: [calendar/types.ts:65](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L65) + +Specific occurrence starts to exclude (EXDATE). Date-only values match by occurrence date. + +*** + +### frequency + +```ts +frequency: RecurrenceFrequency; +``` + +Defined in: [calendar/types.ts:43](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L43) + +How often the event repeats. + +*** + +### interval? + +```ts +optional interval: number; +``` + +Defined in: [calendar/types.ts:48](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L48) + +Repeat every N frequencies (default 1). +E.g. `{ frequency: 'weekly', interval: 2 }` = every other week. + +*** + +### overrides? + +```ts +optional overrides: RecurrenceOverride[]; +``` + +Defined in: [calendar/types.ts:67](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L67) + +Per-occurrence replacements keyed by original occurrence start. + +*** + +### until? + +```ts +optional until: string; +``` + +Defined in: [calendar/types.ts:53](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L53) + +ISO date string (YYYY-MM-DD) — no occurrences start on or after this date. +Takes precedence over `count`. diff --git a/docs/reference/interfaces/ResizeConstraints.md b/docs/reference/interfaces/ResizeConstraints.md new file mode 100644 index 00000000..7da83e72 --- /dev/null +++ b/docs/reference/interfaces/ResizeConstraints.md @@ -0,0 +1,40 @@ +--- +id: ResizeConstraints +title: ResizeConstraints +--- + +# Interface: ResizeConstraints + +Defined in: [calendar/getResizeProps.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L12) + +## Properties + +### minDurationMinutes? + +```ts +optional minDurationMinutes: number; +``` + +Defined in: [calendar/getResizeProps.ts:13](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L13) + +*** + +### snapToMinutes? + +```ts +optional snapToMinutes: number; +``` + +Defined in: [calendar/getResizeProps.ts:14](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L14) + +*** + +### unavailableRanges? + +```ts +optional unavailableRanges: UnavailableTimeRange[]; +``` + +Defined in: [calendar/getResizeProps.ts:16](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L16) + +Unavailable time ranges that the event cannot be resized into diff --git a/docs/reference/interfaces/ResizeControllerOptions.md b/docs/reference/interfaces/ResizeControllerOptions.md new file mode 100644 index 00000000..90392d1d --- /dev/null +++ b/docs/reference/interfaces/ResizeControllerOptions.md @@ -0,0 +1,172 @@ +--- +id: ResizeControllerOptions +title: ResizeControllerOptions +--- + +# Interface: ResizeControllerOptions + +Defined in: [calendar/resizeController.ts:28](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L28) + +## Properties + +### constraints? + +```ts +optional constraints: ResizeConstraints; +``` + +Defined in: [calendar/resizeController.ts:33](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L33) + +*** + +### containerHeight? + +```ts +optional containerHeight: number; +``` + +Defined in: [calendar/resizeController.ts:30](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L30) + +*** + +### containerWidth? + +```ts +optional containerWidth: number; +``` + +Defined in: [calendar/resizeController.ts:31](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L31) + +*** + +### enabled? + +```ts +optional enabled: boolean; +``` + +Defined in: [calendar/resizeController.ts:29](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L29) + +*** + +### onRecurringResizeEnd()? + +```ts +optional onRecurringResizeEnd: (resize) => void; +``` + +Defined in: [calendar/resizeController.ts:36](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L36) + +#### Parameters + +##### resize + +###### eventId + +`string` + +###### newEnd + +`string` + +###### newStart + +`string` + +###### occurrenceStart + +[`EventDateTimeInput`](../type-aliases/EventDateTimeInput.md) + +###### originalEnd + +`string` + +###### originalStart + +`string` + +#### Returns + +`void` + +*** + +### onResizeEnd()? + +```ts +optional onResizeEnd: (eventId, newStart, newEnd) => void; +``` + +Defined in: [calendar/resizeController.ts:35](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L35) + +#### Parameters + +##### eventId + +`string` + +##### newStart + +`string` + +##### newEnd + +`string` + +#### Returns + +`void` + +*** + +### onResizeError()? + +```ts +optional onResizeError: (error) => void; +``` + +Defined in: [calendar/resizeController.ts:44](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L44) + +#### Parameters + +##### error + +[`ResizeError`](ResizeError.md) + +#### Returns + +`void` + +*** + +### onResizeStart()? + +```ts +optional onResizeStart: (eventId, edge) => void; +``` + +Defined in: [calendar/resizeController.ts:34](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L34) + +#### Parameters + +##### eventId + +`string` + +##### edge + +[`ResizeEdge`](../type-aliases/ResizeEdge.md) + +#### Returns + +`void` + +*** + +### orientation? + +```ts +optional orientation: "vertical" | "horizontal"; +``` + +Defined in: [calendar/resizeController.ts:32](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L32) diff --git a/docs/reference/interfaces/ResizeError.md b/docs/reference/interfaces/ResizeError.md new file mode 100644 index 00000000..28463014 --- /dev/null +++ b/docs/reference/interfaces/ResizeError.md @@ -0,0 +1,102 @@ +--- +id: ResizeError +title: ResizeError +--- + +# Interface: ResizeError + +Defined in: [calendar/types.ts:225](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L225) + +Error information when a resize operation is blocked + +## Properties + +### attemptedEnd? + +```ts +optional attemptedEnd: string; +``` + +Defined in: [calendar/types.ts:233](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L233) + +*** + +### attemptedStart? + +```ts +optional attemptedStart: string; +``` + +Defined in: [calendar/types.ts:232](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L232) + +*** + +### conflicts? + +```ts +optional conflicts: AvailabilityConflict[]; +``` + +Defined in: [calendar/types.ts:235](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L235) + +Specific availability conflicts that prevented the resize + +*** + +### eventId + +```ts +eventId: string; +``` + +Defined in: [calendar/types.ts:226](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L226) + +*** + +### eventTitle + +```ts +eventTitle: string; +``` + +Defined in: [calendar/types.ts:227](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L227) + +*** + +### message + +```ts +message: string; +``` + +Defined in: [calendar/types.ts:229](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L229) + +*** + +### originalEnd + +```ts +originalEnd: string; +``` + +Defined in: [calendar/types.ts:231](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L231) + +*** + +### originalStart + +```ts +originalStart: string; +``` + +Defined in: [calendar/types.ts:230](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L230) + +*** + +### reason + +```ts +reason: "unavailable-time" | "invalid-time" | "min-duration" | "blocked"; +``` + +Defined in: [calendar/types.ts:228](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L228) diff --git a/docs/reference/interfaces/ResizeHandleStyle.md b/docs/reference/interfaces/ResizeHandleStyle.md new file mode 100644 index 00000000..b661ad1d --- /dev/null +++ b/docs/reference/interfaces/ResizeHandleStyle.md @@ -0,0 +1,88 @@ +--- +id: ResizeHandleStyle +title: ResizeHandleStyle +--- + +# Interface: ResizeHandleStyle + +Defined in: [calendar/getResizeProps.ts:183](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L183) + +## Properties + +### bottom? + +```ts +optional bottom: number; +``` + +Defined in: [calendar/getResizeProps.ts:191](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L191) + +*** + +### cursor + +```ts +cursor: "ns-resize"; +``` + +Defined in: [calendar/getResizeProps.ts:188](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L188) + +*** + +### height + +```ts +height: string; +``` + +Defined in: [calendar/getResizeProps.ts:187](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L187) + +*** + +### left + +```ts +left: number; +``` + +Defined in: [calendar/getResizeProps.ts:185](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L185) + +*** + +### position + +```ts +position: "absolute"; +``` + +Defined in: [calendar/getResizeProps.ts:184](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L184) + +*** + +### right + +```ts +right: number; +``` + +Defined in: [calendar/getResizeProps.ts:186](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L186) + +*** + +### top? + +```ts +optional top: number; +``` + +Defined in: [calendar/getResizeProps.ts:190](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L190) + +*** + +### zIndex + +```ts +zIndex: number; +``` + +Defined in: [calendar/getResizeProps.ts:189](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L189) diff --git a/docs/reference/interfaces/ResizePreviewOptions.md b/docs/reference/interfaces/ResizePreviewOptions.md new file mode 100644 index 00000000..758a6dc4 --- /dev/null +++ b/docs/reference/interfaces/ResizePreviewOptions.md @@ -0,0 +1,68 @@ +--- +id: ResizePreviewOptions +title: ResizePreviewOptions +--- + +# Interface: ResizePreviewOptions + +Defined in: [calendar/getResizeProps.ts:283](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L283) + +## Properties + +### dayDate + +```ts +dayDate: string; +``` + +Defined in: [calendar/getResizeProps.ts:285](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L285) + +The date string of the day being rendered (YYYY-MM-DD) + +*** + +### originalEnd + +```ts +originalEnd: string; +``` + +Defined in: [calendar/getResizeProps.ts:289](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L289) + +The original end of the event (before resize) + +*** + +### originalStart + +```ts +originalStart: string; +``` + +Defined in: [calendar/getResizeProps.ts:287](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L287) + +The original start of the event (before resize) + +*** + +### previewEnd + +```ts +previewEnd: string; +``` + +Defined in: [calendar/getResizeProps.ts:293](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L293) + +The preview end during resize + +*** + +### previewStart + +```ts +previewStart: string; +``` + +Defined in: [calendar/getResizeProps.ts:291](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L291) + +The preview start during resize diff --git a/docs/reference/interfaces/ResizeStartArgs.md b/docs/reference/interfaces/ResizeStartArgs.md new file mode 100644 index 00000000..d503dd25 --- /dev/null +++ b/docs/reference/interfaces/ResizeStartArgs.md @@ -0,0 +1,101 @@ +--- +id: ResizeStartArgs +title: ResizeStartArgs +--- + +# Interface: ResizeStartArgs + +Defined in: [calendar/resizeController.ts:47](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L47) + +## Properties + +### clientX + +```ts +clientX: number; +``` + +Defined in: [calendar/resizeController.ts:54](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L54) + +*** + +### clientY + +```ts +clientY: number; +``` + +Defined in: [calendar/resizeController.ts:55](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L55) + +*** + +### edge + +```ts +edge: ResizeEdge; +``` + +Defined in: [calendar/resizeController.ts:49](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L49) + +*** + +### eventId + +```ts +eventId: string; +``` + +Defined in: [calendar/resizeController.ts:48](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L48) + +*** + +### occurrenceStart? + +```ts +optional occurrenceStart: EventDateTimeInput; +``` + +Defined in: [calendar/resizeController.ts:52](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L52) + +*** + +### originalEnd + +```ts +originalEnd: string; +``` + +Defined in: [calendar/resizeController.ts:51](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L51) + +*** + +### originalStart + +```ts +originalStart: string; +``` + +Defined in: [calendar/resizeController.ts:50](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L50) + +*** + +### recurrenceScope? + +```ts +optional recurrenceScope: RecurrenceEditScope; +``` + +Defined in: [calendar/resizeController.ts:53](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L53) + +*** + +### target? + +```ts +optional target: HTMLElement | null; +``` + +Defined in: [calendar/resizeController.ts:60](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L60) + +Optional element under the pointer (e.g. `e.target as HTMLElement`). +Used to resolve the originating day column without `getBoundingClientRect`. diff --git a/docs/reference/interfaces/ResizeState.md b/docs/reference/interfaces/ResizeState.md new file mode 100644 index 00000000..c0cb40ef --- /dev/null +++ b/docs/reference/interfaces/ResizeState.md @@ -0,0 +1,98 @@ +--- +id: ResizeState +title: ResizeState +--- + +# Interface: ResizeState + +Defined in: [calendar/resizeController.ts:16](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L16) + +## Properties + +### blocked + +```ts +blocked: boolean; +``` + +Defined in: [calendar/resizeController.ts:25](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L25) + +*** + +### edge + +```ts +edge: ResizeEdge | null; +``` + +Defined in: [calendar/resizeController.ts:19](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L19) + +*** + +### eventId + +```ts +eventId: string | null; +``` + +Defined in: [calendar/resizeController.ts:18](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L18) + +*** + +### isResizing + +```ts +isResizing: boolean; +``` + +Defined in: [calendar/resizeController.ts:17](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L17) + +*** + +### lastValidPreviewEnd + +```ts +lastValidPreviewEnd: string | null; +``` + +Defined in: [calendar/resizeController.ts:23](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L23) + +*** + +### lastValidPreviewStart + +```ts +lastValidPreviewStart: string | null; +``` + +Defined in: [calendar/resizeController.ts:22](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L22) + +*** + +### previewEnd + +```ts +previewEnd: string | null; +``` + +Defined in: [calendar/resizeController.ts:21](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L21) + +*** + +### previewStart + +```ts +previewStart: string | null; +``` + +Defined in: [calendar/resizeController.ts:20](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L20) + +*** + +### targetDayDate + +```ts +targetDayDate: string | null; +``` + +Defined in: [calendar/resizeController.ts:24](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L24) diff --git a/docs/reference/interfaces/ResizeValidationResult.md b/docs/reference/interfaces/ResizeValidationResult.md new file mode 100644 index 00000000..aa7a8cf4 --- /dev/null +++ b/docs/reference/interfaces/ResizeValidationResult.md @@ -0,0 +1,30 @@ +--- +id: ResizeValidationResult +title: ResizeValidationResult +--- + +# Interface: ResizeValidationResult + +Defined in: [calendar/types.ts:241](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L241) + +Result of checking if a resize is valid + +## Properties + +### error? + +```ts +optional error: ResizeError; +``` + +Defined in: [calendar/types.ts:243](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L243) + +*** + +### valid + +```ts +valid: boolean; +``` + +Defined in: [calendar/types.ts:242](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L242) diff --git a/docs/reference/interfaces/Resource.md b/docs/reference/interfaces/Resource.md new file mode 100644 index 00000000..71d87bea --- /dev/null +++ b/docs/reference/interfaces/Resource.md @@ -0,0 +1,70 @@ +--- +id: Resource +title: Resource +--- + +# Interface: Resource + +Defined in: [calendar/types.ts:79](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L79) + +## Properties + +### availability? + +```ts +optional availability: Availability[]; +``` + +Defined in: [calendar/types.ts:82](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L82) + +*** + +### buffer? + +```ts +optional buffer: object; +``` + +Defined in: [calendar/types.ts:84](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L84) + +#### after? + +```ts +optional after: number; +``` + +#### before? + +```ts +optional before: number; +``` + +*** + +### capacity? + +```ts +optional capacity: number[]; +``` + +Defined in: [calendar/types.ts:83](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L83) + +*** + +### id + +```ts +id: string; +``` + +Defined in: [calendar/types.ts:80](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L80) + +*** + +### label + +```ts +label: string; +``` + +Defined in: [calendar/types.ts:81](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L81) diff --git a/docs/reference/interfaces/RoundOptions.md b/docs/reference/interfaces/RoundOptions.md new file mode 100644 index 00000000..005206c6 --- /dev/null +++ b/docs/reference/interfaces/RoundOptions.md @@ -0,0 +1,90 @@ +--- +id: RoundOptions +title: RoundOptions +--- + +# Interface: RoundOptions + +Defined in: [date/round/round.ts:17](https://github.com/TanStack/time/blob/main/packages/time/src/date/round/round.ts#L17) + +## Extends + +- `DateOperationOptions` + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +```ts +DateOperationOptions.calendar +``` + +*** + +### returnFormat? + +```ts +optional returnFormat: ReturnFormat; +``` + +Defined in: [date/withDateOperation/withDateOperation.ts:9](https://github.com/TanStack/time/blob/main/packages/time/src/date/withDateOperation/withDateOperation.ts#L9) + +#### Inherited from + +```ts +DateOperationOptions.returnFormat +``` + +*** + +### roundingIncrement? + +```ts +optional roundingIncrement: number; +``` + +Defined in: [date/round/round.ts:20](https://github.com/TanStack/time/blob/main/packages/time/src/date/round/round.ts#L20) + +*** + +### roundingMode? + +```ts +optional roundingMode: RoundingMode; +``` + +Defined in: [date/round/round.ts:19](https://github.com/TanStack/time/blob/main/packages/time/src/date/round/round.ts#L19) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +```ts +DateOperationOptions.timeZone +``` + +*** + +### unit + +```ts +unit: RoundUnit; +``` + +Defined in: [date/round/round.ts:18](https://github.com/TanStack/time/blob/main/packages/time/src/date/round/round.ts#L18) diff --git a/docs/reference/interfaces/SegmentInfo.md b/docs/reference/interfaces/SegmentInfo.md new file mode 100644 index 00000000..7d9a138b --- /dev/null +++ b/docs/reference/interfaces/SegmentInfo.md @@ -0,0 +1,94 @@ +--- +id: SegmentInfo +title: SegmentInfo +--- + +# Interface: SegmentInfo + +Defined in: [calendar/getResizeProps.ts:213](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L213) + +Information about a segment's position within a multi-day event + +## Properties + +### isFirstSegment + +```ts +isFirstSegment: boolean; +``` + +Defined in: [calendar/getResizeProps.ts:215](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L215) + +Whether this is the first segment of a multi-day event + +*** + +### isLastSegment + +```ts +isLastSegment: boolean; +``` + +Defined in: [calendar/getResizeProps.ts:217](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L217) + +Whether this is the last segment of a multi-day event + +*** + +### isSplitEvent + +```ts +isSplitEvent: boolean; +``` + +Defined in: [calendar/getResizeProps.ts:219](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L219) + +Whether this segment is part of a split multi-day event + +*** + +### originalEnd + +```ts +originalEnd: string; +``` + +Defined in: [calendar/getResizeProps.ts:223](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L223) + +The original event end (before splitting) + +*** + +### originalStart + +```ts +originalStart: string; +``` + +Defined in: [calendar/getResizeProps.ts:221](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L221) + +The original event start (before splitting) + +*** + +### segmentEnd + +```ts +segmentEnd: string; +``` + +Defined in: [calendar/getResizeProps.ts:227](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L227) + +The segment's end time + +*** + +### segmentStart + +```ts +segmentStart: string; +``` + +Defined in: [calendar/getResizeProps.ts:225](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L225) + +The segment's start time diff --git a/docs/reference/interfaces/SegmentResizePreview.md b/docs/reference/interfaces/SegmentResizePreview.md new file mode 100644 index 00000000..0d9faebd --- /dev/null +++ b/docs/reference/interfaces/SegmentResizePreview.md @@ -0,0 +1,46 @@ +--- +id: SegmentResizePreview +title: SegmentResizePreview +--- + +# Interface: SegmentResizePreview + +Defined in: [calendar/getResizeProps.ts:274](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L274) + +Result of resize preview calculation for a segment + +## Properties + +### hasChanged + +```ts +hasChanged: boolean; +``` + +Defined in: [calendar/getResizeProps.ts:280](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L280) + +Whether the preview has changed from the original + +*** + +### previewStyle + +```ts +previewStyle: PositionStyle | null; +``` + +Defined in: [calendar/getResizeProps.ts:278](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L278) + +The preview style to apply, if any + +*** + +### shouldHide + +```ts +shouldHide: boolean; +``` + +Defined in: [calendar/getResizeProps.ts:276](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L276) + +Whether the segment should be hidden (shrunk away) diff --git a/docs/reference/interfaces/SetFields.md b/docs/reference/interfaces/SetFields.md new file mode 100644 index 00000000..a76d4a11 --- /dev/null +++ b/docs/reference/interfaces/SetFields.md @@ -0,0 +1,98 @@ +--- +id: SetFields +title: SetFields +--- + +# Interface: SetFields + +Defined in: [date/set/set.ts:5](https://github.com/TanStack/time/blob/main/packages/time/src/date/set/set.ts#L5) + +## Properties + +### day? + +```ts +optional day: number; +``` + +Defined in: [date/set/set.ts:8](https://github.com/TanStack/time/blob/main/packages/time/src/date/set/set.ts#L8) + +*** + +### hour? + +```ts +optional hour: number; +``` + +Defined in: [date/set/set.ts:9](https://github.com/TanStack/time/blob/main/packages/time/src/date/set/set.ts#L9) + +*** + +### microsecond? + +```ts +optional microsecond: number; +``` + +Defined in: [date/set/set.ts:13](https://github.com/TanStack/time/blob/main/packages/time/src/date/set/set.ts#L13) + +*** + +### millisecond? + +```ts +optional millisecond: number; +``` + +Defined in: [date/set/set.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/set/set.ts#L12) + +*** + +### minute? + +```ts +optional minute: number; +``` + +Defined in: [date/set/set.ts:10](https://github.com/TanStack/time/blob/main/packages/time/src/date/set/set.ts#L10) + +*** + +### month? + +```ts +optional month: number; +``` + +Defined in: [date/set/set.ts:7](https://github.com/TanStack/time/blob/main/packages/time/src/date/set/set.ts#L7) + +*** + +### nanosecond? + +```ts +optional nanosecond: number; +``` + +Defined in: [date/set/set.ts:14](https://github.com/TanStack/time/blob/main/packages/time/src/date/set/set.ts#L14) + +*** + +### second? + +```ts +optional second: number; +``` + +Defined in: [date/set/set.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/set/set.ts#L11) + +*** + +### year? + +```ts +optional year: number; +``` + +Defined in: [date/set/set.ts:6](https://github.com/TanStack/time/blob/main/packages/time/src/date/set/set.ts#L6) diff --git a/docs/reference/interfaces/SetOptions.md b/docs/reference/interfaces/SetOptions.md new file mode 100644 index 00000000..4d15cbb8 --- /dev/null +++ b/docs/reference/interfaces/SetOptions.md @@ -0,0 +1,70 @@ +--- +id: SetOptions +title: SetOptions +--- + +# Interface: SetOptions + +Defined in: [date/set/set.ts:17](https://github.com/TanStack/time/blob/main/packages/time/src/date/set/set.ts#L17) + +## Extends + +- `DateOperationOptions` + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +```ts +DateOperationOptions.calendar +``` + +*** + +### fields + +```ts +fields: SetFields; +``` + +Defined in: [date/set/set.ts:18](https://github.com/TanStack/time/blob/main/packages/time/src/date/set/set.ts#L18) + +*** + +### returnFormat? + +```ts +optional returnFormat: ReturnFormat; +``` + +Defined in: [date/withDateOperation/withDateOperation.ts:9](https://github.com/TanStack/time/blob/main/packages/time/src/date/withDateOperation/withDateOperation.ts#L9) + +#### Inherited from + +```ts +DateOperationOptions.returnFormat +``` + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +```ts +DateOperationOptions.timeZone +``` diff --git a/docs/reference/interfaces/SinceOptions.md b/docs/reference/interfaces/SinceOptions.md new file mode 100644 index 00000000..1d186d23 --- /dev/null +++ b/docs/reference/interfaces/SinceOptions.md @@ -0,0 +1,50 @@ +--- +id: SinceOptions +title: SinceOptions +--- + +# Interface: SinceOptions + +Defined in: [date/since/since.ts:6](https://github.com/TanStack/time/blob/main/packages/time/src/date/since/since.ts#L6) + +## Extends + +- [`DateOptions`](DateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`calendar`](DateOptions.md#calendar) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`timeZone`](DateOptions.md#timezone) + +*** + +### unit + +```ts +unit: DateTimeUnit; +``` + +Defined in: [date/since/since.ts:7](https://github.com/TanStack/time/blob/main/packages/time/src/date/since/since.ts#L7) diff --git a/docs/reference/interfaces/StartOfOptions.md b/docs/reference/interfaces/StartOfOptions.md new file mode 100644 index 00000000..ad444e38 --- /dev/null +++ b/docs/reference/interfaces/StartOfOptions.md @@ -0,0 +1,70 @@ +--- +id: StartOfOptions +title: StartOfOptions +--- + +# Interface: StartOfOptions + +Defined in: [date/startOf/startOf.ts:15](https://github.com/TanStack/time/blob/main/packages/time/src/date/startOf/startOf.ts#L15) + +## Extends + +- `DateOperationOptions` + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +```ts +DateOperationOptions.calendar +``` + +*** + +### returnFormat? + +```ts +optional returnFormat: ReturnFormat; +``` + +Defined in: [date/withDateOperation/withDateOperation.ts:9](https://github.com/TanStack/time/blob/main/packages/time/src/date/withDateOperation/withDateOperation.ts#L9) + +#### Inherited from + +```ts +DateOperationOptions.returnFormat +``` + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +```ts +DateOperationOptions.timeZone +``` + +*** + +### unit + +```ts +unit: StartOfUnit; +``` + +Defined in: [date/startOf/startOf.ts:16](https://github.com/TanStack/time/blob/main/packages/time/src/date/startOf/startOf.ts#L16) diff --git a/docs/reference/interfaces/SubtractOptions.md b/docs/reference/interfaces/SubtractOptions.md new file mode 100644 index 00000000..06f82129 --- /dev/null +++ b/docs/reference/interfaces/SubtractOptions.md @@ -0,0 +1,70 @@ +--- +id: SubtractOptions +title: SubtractOptions +--- + +# Interface: SubtractOptions + +Defined in: [date/subtract/subtract.ts:5](https://github.com/TanStack/time/blob/main/packages/time/src/date/subtract/subtract.ts#L5) + +## Extends + +- `DateOperationOptions` + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +```ts +DateOperationOptions.calendar +``` + +*** + +### duration + +```ts +duration: DurationLike; +``` + +Defined in: [date/subtract/subtract.ts:6](https://github.com/TanStack/time/blob/main/packages/time/src/date/subtract/subtract.ts#L6) + +*** + +### returnFormat? + +```ts +optional returnFormat: ReturnFormat; +``` + +Defined in: [date/withDateOperation/withDateOperation.ts:9](https://github.com/TanStack/time/blob/main/packages/time/src/date/withDateOperation/withDateOperation.ts#L9) + +#### Inherited from + +```ts +DateOperationOptions.returnFormat +``` + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +```ts +DateOperationOptions.timeZone +``` diff --git a/docs/reference/interfaces/TimeEventInfo.md b/docs/reference/interfaces/TimeEventInfo.md new file mode 100644 index 00000000..3c7c6e56 --- /dev/null +++ b/docs/reference/interfaces/TimeEventInfo.md @@ -0,0 +1,48 @@ +--- +id: TimeEventInfo +title: TimeEventInfo +--- + +# Interface: TimeEventInfo + +Defined in: [client/TimeClient.ts:7](https://github.com/TanStack/time/blob/main/packages/time/src/client/TimeClient.ts#L7) + +## Properties + +### end + +```ts +end: string; +``` + +Defined in: [client/TimeClient.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/client/TimeClient.ts#L11) + +*** + +### eventId + +```ts +eventId: string; +``` + +Defined in: [client/TimeClient.ts:8](https://github.com/TanStack/time/blob/main/packages/time/src/client/TimeClient.ts#L8) + +*** + +### eventTitle + +```ts +eventTitle: string; +``` + +Defined in: [client/TimeClient.ts:9](https://github.com/TanStack/time/blob/main/packages/time/src/client/TimeClient.ts#L9) + +*** + +### start + +```ts +start: string; +``` + +Defined in: [client/TimeClient.ts:10](https://github.com/TanStack/time/blob/main/packages/time/src/client/TimeClient.ts#L10) diff --git a/docs/reference/interfaces/TimeEventMap.md b/docs/reference/interfaces/TimeEventMap.md new file mode 100644 index 00000000..0e0bf676 --- /dev/null +++ b/docs/reference/interfaces/TimeEventMap.md @@ -0,0 +1,244 @@ +--- +id: TimeEventMap +title: TimeEventMap +--- + +# Interface: TimeEventMap + +Defined in: [client/TimeClient.ts:17](https://github.com/TanStack/time/blob/main/packages/time/src/client/TimeClient.ts#L17) + +Event map for TimeClient events + +## Properties + +### time:calendar:navigate + +```ts +time:calendar:navigate: object; +``` + +Defined in: [client/TimeClient.ts:48](https://github.com/TanStack/time/blob/main/packages/time/src/client/TimeClient.ts#L48) + +#### direction + +```ts +direction: "previous" | "next" | "current" | "specific"; +``` + +#### targetDate + +```ts +targetDate: string; +``` + +*** + +### time:calendar:viewMode:changed + +```ts +time:calendar:viewMode:changed: object; +``` + +Defined in: [client/TimeClient.ts:52](https://github.com/TanStack/time/blob/main/packages/time/src/client/TimeClient.ts#L52) + +#### viewMode + +```ts +viewMode: object; +``` + +##### viewMode.unit + +```ts +unit: string; +``` + +##### viewMode.value + +```ts +value: number; +``` + +*** + +### time:event:added + +```ts +time:event:added: TimeEventInfo; +``` + +Defined in: [client/TimeClient.ts:18](https://github.com/TanStack/time/blob/main/packages/time/src/client/TimeClient.ts#L18) + +*** + +### time:event:redo + +```ts +time:event:redo: object; +``` + +Defined in: [client/TimeClient.ts:31](https://github.com/TanStack/time/blob/main/packages/time/src/client/TimeClient.ts#L31) + +#### added + +```ts +added: TimeEventInfo[]; +``` + +#### removed + +```ts +removed: TimeEventInfo[]; +``` + +#### updated + +```ts +updated: TimeEventInfo[]; +``` + +*** + +### time:event:removed + +```ts +time:event:removed: TimeEventInfo; +``` + +Defined in: [client/TimeClient.ts:25](https://github.com/TanStack/time/blob/main/packages/time/src/client/TimeClient.ts#L25) + +*** + +### time:event:resized + +```ts +time:event:resized: TimeEventInfo; +``` + +Defined in: [client/TimeClient.ts:36](https://github.com/TanStack/time/blob/main/packages/time/src/client/TimeClient.ts#L36) + +*** + +### time:event:undo + +```ts +time:event:undo: object; +``` + +Defined in: [client/TimeClient.ts:26](https://github.com/TanStack/time/blob/main/packages/time/src/client/TimeClient.ts#L26) + +#### added + +```ts +added: TimeEventInfo[]; +``` + +#### removed + +```ts +removed: TimeEventInfo[]; +``` + +#### updated + +```ts +updated: TimeEventInfo[]; +``` + +*** + +### time:event:update:error + +```ts +time:event:update:error: object; +``` + +Defined in: [client/TimeClient.ts:37](https://github.com/TanStack/time/blob/main/packages/time/src/client/TimeClient.ts#L37) + +#### attemptedEnd? + +```ts +optional attemptedEnd: string; +``` + +#### attemptedStart? + +```ts +optional attemptedStart: string; +``` + +#### conflicts? + +```ts +optional conflicts: AvailabilityConflict[]; +``` + +#### eventId + +```ts +eventId: string; +``` + +#### eventTitle + +```ts +eventTitle: string; +``` + +#### message + +```ts +message: string; +``` + +#### originalEnd + +```ts +originalEnd: string; +``` + +#### originalStart + +```ts +originalStart: string; +``` + +#### reason + +```ts +reason: "unavailable-time" | "invalid-time" | "min-duration" | "blocked"; +``` + +*** + +### time:event:updated + +```ts +time:event:updated: TimeEventInfo & object; +``` + +Defined in: [client/TimeClient.ts:22](https://github.com/TanStack/time/blob/main/packages/time/src/client/TimeClient.ts#L22) + +#### Type Declaration + +##### updates + +```ts +updates: Record; +``` + +*** + +### time:events:set + +```ts +time:events:set: object; +``` + +Defined in: [client/TimeClient.ts:19](https://github.com/TanStack/time/blob/main/packages/time/src/client/TimeClient.ts#L19) + +#### events + +```ts +events: TimeEventInfo[]; +``` diff --git a/docs/reference/interfaces/TimeSlot.md b/docs/reference/interfaces/TimeSlot.md new file mode 100644 index 00000000..79c11d46 --- /dev/null +++ b/docs/reference/interfaces/TimeSlot.md @@ -0,0 +1,38 @@ +--- +id: TimeSlot +title: TimeSlot +--- + +# Interface: TimeSlot + +Defined in: [calendar/types.ts:157](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L157) + +## Properties + +### hour + +```ts +hour: number; +``` + +Defined in: [calendar/types.ts:158](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L158) + +*** + +### label + +```ts +label: string; +``` + +Defined in: [calendar/types.ts:160](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L160) + +*** + +### minute + +```ts +minute: number; +``` + +Defined in: [calendar/types.ts:159](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L159) diff --git a/docs/reference/interfaces/TimelineEventLayout.md b/docs/reference/interfaces/TimelineEventLayout.md new file mode 100644 index 00000000..773814c2 --- /dev/null +++ b/docs/reference/interfaces/TimelineEventLayout.md @@ -0,0 +1,82 @@ +--- +id: TimelineEventLayout +title: TimelineEventLayout +--- + +# Interface: TimelineEventLayout\ + +Defined in: [calendar/types.ts:251](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L251) + +## Type Parameters + +### TResource + +`TResource` *extends* [`Resource`](Resource.md) = [`Resource`](Resource.md) + +### TEvent + +`TEvent` *extends* [`Event`](Event.md)\<`TResource`\> = [`Event`](Event.md)\<`TResource`\> + +## Properties + +### event + +```ts +event: TEvent; +``` + +Defined in: [calendar/types.ts:255](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L255) + +*** + +### isEndClipped + +```ts +isEndClipped: boolean; +``` + +Defined in: [calendar/types.ts:262](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L262) + +True when the event ends after the last visible day (right edge is clipped) + +*** + +### isStartClipped + +```ts +isStartClipped: boolean; +``` + +Defined in: [calendar/types.ts:260](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L260) + +True when the event starts before the first visible day (left edge is clipped) + +*** + +### lane + +```ts +lane: number; +``` + +Defined in: [calendar/types.ts:258](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L258) + +*** + +### left + +```ts +left: number; +``` + +Defined in: [calendar/types.ts:256](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L256) + +*** + +### width + +```ts +width: number; +``` + +Defined in: [calendar/types.ts:257](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L257) diff --git a/docs/reference/interfaces/TimelineLayout.md b/docs/reference/interfaces/TimelineLayout.md new file mode 100644 index 00000000..3e96f7be --- /dev/null +++ b/docs/reference/interfaces/TimelineLayout.md @@ -0,0 +1,38 @@ +--- +id: TimelineLayout +title: TimelineLayout +--- + +# Interface: TimelineLayout\ + +Defined in: [calendar/types.ts:274](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L274) + +## Type Parameters + +### TResource + +`TResource` *extends* [`Resource`](Resource.md) = [`Resource`](Resource.md) + +### TEvent + +`TEvent` *extends* [`Event`](Event.md)\<`TResource`\> = [`Event`](Event.md)\<`TResource`\> + +## Properties + +### currentTimePosition + +```ts +currentTimePosition: number | null; +``` + +Defined in: [calendar/types.ts:279](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L279) + +*** + +### rows + +```ts +rows: TimelineResourceRow[]; +``` + +Defined in: [calendar/types.ts:278](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L278) diff --git a/docs/reference/interfaces/TimelineResizePreviewOptions.md b/docs/reference/interfaces/TimelineResizePreviewOptions.md new file mode 100644 index 00000000..fa2a7b02 --- /dev/null +++ b/docs/reference/interfaces/TimelineResizePreviewOptions.md @@ -0,0 +1,48 @@ +--- +id: TimelineResizePreviewOptions +title: TimelineResizePreviewOptions +--- + +# Interface: TimelineResizePreviewOptions + +Defined in: [calendar/getResizeProps.ts:437](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L437) + +## Properties + +### firstDayIso + +```ts +firstDayIso: string; +``` + +Defined in: [calendar/getResizeProps.ts:440](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L440) + +*** + +### previewEnd + +```ts +previewEnd: string; +``` + +Defined in: [calendar/getResizeProps.ts:439](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L439) + +*** + +### previewStart + +```ts +previewStart: string; +``` + +Defined in: [calendar/getResizeProps.ts:438](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L438) + +*** + +### totalDays + +```ts +totalDays: number; +``` + +Defined in: [calendar/getResizeProps.ts:441](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L441) diff --git a/docs/reference/interfaces/TimelineResizePreviewStyle.md b/docs/reference/interfaces/TimelineResizePreviewStyle.md new file mode 100644 index 00000000..eae1906c --- /dev/null +++ b/docs/reference/interfaces/TimelineResizePreviewStyle.md @@ -0,0 +1,28 @@ +--- +id: TimelineResizePreviewStyle +title: TimelineResizePreviewStyle +--- + +# Interface: TimelineResizePreviewStyle + +Defined in: [calendar/getResizeProps.ts:444](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L444) + +## Properties + +### left + +```ts +left: string; +``` + +Defined in: [calendar/getResizeProps.ts:445](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L445) + +*** + +### width + +```ts +width: string; +``` + +Defined in: [calendar/getResizeProps.ts:446](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L446) diff --git a/docs/reference/interfaces/TimelineResourceRow.md b/docs/reference/interfaces/TimelineResourceRow.md new file mode 100644 index 00000000..94288477 --- /dev/null +++ b/docs/reference/interfaces/TimelineResourceRow.md @@ -0,0 +1,48 @@ +--- +id: TimelineResourceRow +title: TimelineResourceRow +--- + +# Interface: TimelineResourceRow\ + +Defined in: [calendar/types.ts:265](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L265) + +## Type Parameters + +### TResource + +`TResource` *extends* [`Resource`](Resource.md) = [`Resource`](Resource.md) + +### TEvent + +`TEvent` *extends* [`Event`](Event.md)\<`TResource`\> = [`Event`](Event.md)\<`TResource`\> + +## Properties + +### events + +```ts +events: TimelineEventLayout[]; +``` + +Defined in: [calendar/types.ts:270](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L270) + +*** + +### laneCount + +```ts +laneCount: number; +``` + +Defined in: [calendar/types.ts:271](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L271) + +*** + +### resource + +```ts +resource: TResource; +``` + +Defined in: [calendar/types.ts:269](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L269) diff --git a/docs/reference/interfaces/UnavailabilityReason.md b/docs/reference/interfaces/UnavailabilityReason.md new file mode 100644 index 00000000..031da546 --- /dev/null +++ b/docs/reference/interfaces/UnavailabilityReason.md @@ -0,0 +1,88 @@ +--- +id: UnavailabilityReason +title: UnavailabilityReason +--- + +# Interface: UnavailabilityReason + +Defined in: [calendar/types.ts:186](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L186) + +Information about why a resource is unavailable + +## Properties + +### capacityInfo? + +```ts +optional capacityInfo: object; +``` + +Defined in: [calendar/types.ts:196](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L196) + +Current capacity usage if applicable + +#### max + +```ts +max: number; +``` + +#### remaining + +```ts +remaining: number; +``` + +#### used + +```ts +used: number; +``` + +*** + +### description + +```ts +description: string; +``` + +Defined in: [calendar/types.ts:194](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L194) + +Human-readable explanation + +*** + +### reason + +```ts +reason: "outside-hours" | "capacity" | "no-availability"; +``` + +Defined in: [calendar/types.ts:192](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L192) + +Why the resource is unavailable + +*** + +### resourceId + +```ts +resourceId: string; +``` + +Defined in: [calendar/types.ts:188](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L188) + +Resource ID + +*** + +### resourceLabel + +```ts +resourceLabel: string; +``` + +Defined in: [calendar/types.ts:190](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L190) + +Resource label/name diff --git a/docs/reference/interfaces/UnavailableRange.md b/docs/reference/interfaces/UnavailableRange.md new file mode 100644 index 00000000..a1765ba7 --- /dev/null +++ b/docs/reference/interfaces/UnavailableRange.md @@ -0,0 +1,56 @@ +--- +id: UnavailableRange +title: UnavailableRange +--- + +# Interface: UnavailableRange + +Defined in: [calendar/types.ts:163](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L163) + +## Properties + +### endTime + +```ts +endTime: string; +``` + +Defined in: [calendar/types.ts:171](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L171) + +End time as HH:mm string + +*** + +### height + +```ts +height: number; +``` + +Defined in: [calendar/types.ts:167](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L167) + +Height in pixels + +*** + +### startTime + +```ts +startTime: string; +``` + +Defined in: [calendar/types.ts:169](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L169) + +Start time as HH:mm string + +*** + +### top + +```ts +top: number; +``` + +Defined in: [calendar/types.ts:165](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L165) + +Top position in pixels diff --git a/docs/reference/interfaces/UnavailableTimeRange.md b/docs/reference/interfaces/UnavailableTimeRange.md new file mode 100644 index 00000000..8ae1abf4 --- /dev/null +++ b/docs/reference/interfaces/UnavailableTimeRange.md @@ -0,0 +1,32 @@ +--- +id: UnavailableTimeRange +title: UnavailableTimeRange +--- + +# Interface: UnavailableTimeRange + +Defined in: [calendar/getResizeProps.ts:5](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L5) + +## Properties + +### endMinutes + +```ts +endMinutes: number; +``` + +Defined in: [calendar/getResizeProps.ts:9](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L9) + +End time in minutes from midnight (0-1440) + +*** + +### startMinutes + +```ts +startMinutes: number; +``` + +Defined in: [calendar/getResizeProps.ts:7](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L7) + +Start time in minutes from midnight (0-1440) diff --git a/docs/reference/interfaces/UntilOptions.md b/docs/reference/interfaces/UntilOptions.md new file mode 100644 index 00000000..6eb7aa61 --- /dev/null +++ b/docs/reference/interfaces/UntilOptions.md @@ -0,0 +1,50 @@ +--- +id: UntilOptions +title: UntilOptions +--- + +# Interface: UntilOptions + +Defined in: [date/until/until.ts:6](https://github.com/TanStack/time/blob/main/packages/time/src/date/until/until.ts#L6) + +## Extends + +- [`DateOptions`](DateOptions.md) + +## Properties + +### calendar? + +```ts +optional calendar: string; +``` + +Defined in: [date/types.ts:11](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L11) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`calendar`](DateOptions.md#calendar) + +*** + +### timeZone? + +```ts +optional timeZone: string; +``` + +Defined in: [date/types.ts:12](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L12) + +#### Inherited from + +[`DateOptions`](DateOptions.md).[`timeZone`](DateOptions.md#timezone) + +*** + +### unit + +```ts +unit: DateTimeUnit; +``` + +Defined in: [date/until/until.ts:7](https://github.com/TanStack/time/blob/main/packages/time/src/date/until/until.ts#L7) diff --git a/docs/reference/interfaces/ValidateResizeOptions.md b/docs/reference/interfaces/ValidateResizeOptions.md new file mode 100644 index 00000000..a6c702b8 --- /dev/null +++ b/docs/reference/interfaces/ValidateResizeOptions.md @@ -0,0 +1,98 @@ +--- +id: ValidateResizeOptions +title: ValidateResizeOptions +--- + +# Interface: ValidateResizeOptions + +Defined in: [calendar/calendar.ts:291](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L291) + +## Properties + +### constraints? + +```ts +optional constraints: ResizeConstraints; +``` + +Defined in: [calendar/calendar.ts:300](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L300) + +*** + +### edge + +```ts +edge: ResizeEdge; +``` + +Defined in: [calendar/calendar.ts:295](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L295) + +*** + +### eventId + +```ts +eventId: string; +``` + +Defined in: [calendar/calendar.ts:292](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L292) + +*** + +### occurrenceStart? + +```ts +optional occurrenceStart: EventDateTimeInput; +``` + +Defined in: [calendar/calendar.ts:299](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L299) + +*** + +### originalDayDate + +```ts +originalDayDate: string; +``` + +Defined in: [calendar/calendar.ts:298](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L298) + +*** + +### originalEnd + +```ts +originalEnd: string; +``` + +Defined in: [calendar/calendar.ts:294](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L294) + +*** + +### originalStart + +```ts +originalStart: string; +``` + +Defined in: [calendar/calendar.ts:293](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L293) + +*** + +### targetDayDate + +```ts +targetDayDate: string; +``` + +Defined in: [calendar/calendar.ts:297](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L297) + +*** + +### totalDeltaMinutes + +```ts +totalDeltaMinutes: number; +``` + +Defined in: [calendar/calendar.ts:296](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L296) diff --git a/docs/reference/interfaces/ValidateResizeResult.md b/docs/reference/interfaces/ValidateResizeResult.md new file mode 100644 index 00000000..4ae7bdb9 --- /dev/null +++ b/docs/reference/interfaces/ValidateResizeResult.md @@ -0,0 +1,84 @@ +--- +id: ValidateResizeResult +title: ValidateResizeResult +--- + +# Interface: ValidateResizeResult + +Defined in: [calendar/calendar.ts:303](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L303) + +## Properties + +### blocked + +```ts +blocked: boolean; +``` + +Defined in: [calendar/calendar.ts:304](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L304) + +*** + +### error? + +```ts +optional error: object; +``` + +Defined in: [calendar/calendar.ts:305](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L305) + +#### conflicts + +```ts +conflicts: AvailabilityConflict[]; +``` + +#### message + +```ts +message: string; +``` + +#### reason + +```ts +reason: "unavailable-time" | "invalid-time" | "min-duration" | "blocked"; +``` + +*** + +### result + +```ts +result: object; +``` + +Defined in: [calendar/calendar.ts:310](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L310) + +#### durationMinutes + +```ts +durationMinutes: number; +``` + +#### end + +```ts +end: string; +``` + +#### start + +```ts +start: string; +``` + +*** + +### targetDayDate + +```ts +targetDayDate: string; +``` + +Defined in: [calendar/calendar.ts:315](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/calendar.ts#L315) diff --git a/docs/reference/interfaces/ViewMode.md b/docs/reference/interfaces/ViewMode.md new file mode 100644 index 00000000..b2e80af0 --- /dev/null +++ b/docs/reference/interfaces/ViewMode.md @@ -0,0 +1,35 @@ +--- +id: ViewMode +title: ViewMode +--- + +# Interface: ViewMode + +Defined in: [calendar/types.ts:94](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L94) + +Represents the configuration for the current viewing mode of a calendar, +specifying the scale and unit of time. + +## Properties + +### unit + +```ts +unit: "month" | "day" | "week" | "workWeek"; +``` + +Defined in: [calendar/types.ts:98](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L98) + +The unit of time that the calendar view should display (month, week, workWeek or day). + +*** + +### value + +```ts +value: number; +``` + +Defined in: [calendar/types.ts:96](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L96) + +The number of units for the view mode. diff --git a/docs/reference/type-aliases/CeilUnit.md b/docs/reference/type-aliases/CeilUnit.md new file mode 100644 index 00000000..a12abd15 --- /dev/null +++ b/docs/reference/type-aliases/CeilUnit.md @@ -0,0 +1,19 @@ +--- +id: CeilUnit +title: CeilUnit +--- + +# Type Alias: CeilUnit + +```ts +type CeilUnit = + | "day" + | "hour" + | "minute" + | "second" + | "millisecond" + | "microsecond" + | "nanosecond"; +``` + +Defined in: [date/ceil/ceil.ts:5](https://github.com/TanStack/time/blob/main/packages/time/src/date/ceil/ceil.ts#L5) diff --git a/docs/reference/type-aliases/CountUnit.md b/docs/reference/type-aliases/CountUnit.md new file mode 100644 index 00000000..07abb0f3 --- /dev/null +++ b/docs/reference/type-aliases/CountUnit.md @@ -0,0 +1,20 @@ +--- +id: CountUnit +title: CountUnit +--- + +# Type Alias: CountUnit + +```ts +type CountUnit = + | "year" + | "month" + | "week" + | "day" + | "hour" + | "minute" + | "second" + | "millisecond"; +``` + +Defined in: [date/count/count.ts:5](https://github.com/TanStack/time/blob/main/packages/time/src/date/count/count.ts#L5) diff --git a/docs/reference/type-aliases/DateInput.md b/docs/reference/type-aliases/DateInput.md new file mode 100644 index 00000000..a62d63b6 --- /dev/null +++ b/docs/reference/type-aliases/DateInput.md @@ -0,0 +1,12 @@ +--- +id: DateInput +title: DateInput +--- + +# Type Alias: DateInput + +```ts +type DateInput = string | number | Date | Temporal.ZonedDateTime | Temporal.PlainDate; +``` + +Defined in: [date/types.ts:3](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L3) diff --git a/docs/reference/type-aliases/Day.md b/docs/reference/type-aliases/Day.md new file mode 100644 index 00000000..aa5754f2 --- /dev/null +++ b/docs/reference/type-aliases/Day.md @@ -0,0 +1,88 @@ +--- +id: Day +title: Day +--- + +# Type Alias: Day\ + +```ts +type Day = object; +``` + +Defined in: [calendar/types.ts:137](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L137) + +## Type Parameters + +### TResource + +`TResource` *extends* [`Resource`](../interfaces/Resource.md) = [`Resource`](../interfaces/Resource.md) + +### TEvent + +`TEvent` *extends* [`Event`](../interfaces/Event.md)\<`TResource`\> = [`Event`](../interfaces/Event.md)\<`TResource`\> + +## Properties + +### allDayEvents + +```ts +allDayEvents: TEvent[]; +``` + +Defined in: [calendar/types.ts:147](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L147) + +All-day events occurring on this day (segments of multi-day all-day events included). + +*** + +### date + +```ts +date: Temporal.PlainDate; +``` + +Defined in: [calendar/types.ts:141](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L141) + +*** + +### events + +```ts +events: TEvent[]; +``` + +Defined in: [calendar/types.ts:145](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L145) + +Timed events occurring on this day (sub-day events + segments of timed multi-day events). + +*** + +### isInCurrentPeriod + +```ts +isInCurrentPeriod: boolean; +``` + +Defined in: [calendar/types.ts:149](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L149) + +*** + +### isoDate + +```ts +isoDate: string; +``` + +Defined in: [calendar/types.ts:143](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L143) + +Pre-computed ISO date string (YYYY-MM-DD) — use instead of manually formatting `date` + +*** + +### isToday + +```ts +isToday: boolean; +``` + +Defined in: [calendar/types.ts:148](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L148) diff --git a/docs/reference/type-aliases/DependencyType.md b/docs/reference/type-aliases/DependencyType.md new file mode 100644 index 00000000..dfee64f8 --- /dev/null +++ b/docs/reference/type-aliases/DependencyType.md @@ -0,0 +1,14 @@ +--- +id: DependencyType +title: DependencyType +--- + +# Type Alias: DependencyType + +```ts +type DependencyType = "FS" | "SS" | "FF" | "SF"; +``` + +Defined in: [calendar/types.ts:10](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L10) + +Supported dependency types for ordering events. diff --git a/docs/reference/type-aliases/DurationLike.md b/docs/reference/type-aliases/DurationLike.md new file mode 100644 index 00000000..ecdccc6f --- /dev/null +++ b/docs/reference/type-aliases/DurationLike.md @@ -0,0 +1,12 @@ +--- +id: DurationLike +title: DurationLike +--- + +# Type Alias: DurationLike + +```ts +type DurationLike = Temporal.DurationLike; +``` + +Defined in: [date/types.ts:15](https://github.com/TanStack/time/blob/main/packages/time/src/date/types.ts#L15) diff --git a/docs/reference/type-aliases/EndOfUnit.md b/docs/reference/type-aliases/EndOfUnit.md new file mode 100644 index 00000000..56e11564 --- /dev/null +++ b/docs/reference/type-aliases/EndOfUnit.md @@ -0,0 +1,20 @@ +--- +id: EndOfUnit +title: EndOfUnit +--- + +# Type Alias: EndOfUnit + +```ts +type EndOfUnit = + | "year" + | "month" + | "week" + | "day" + | "hour" + | "minute" + | "second" + | "millisecond"; +``` + +Defined in: [date/endOf/endOf.ts:5](https://github.com/TanStack/time/blob/main/packages/time/src/date/endOf/endOf.ts#L5) diff --git a/docs/reference/type-aliases/EqualsUnit.md b/docs/reference/type-aliases/EqualsUnit.md new file mode 100644 index 00000000..57c99027 --- /dev/null +++ b/docs/reference/type-aliases/EqualsUnit.md @@ -0,0 +1,20 @@ +--- +id: EqualsUnit +title: EqualsUnit +--- + +# Type Alias: EqualsUnit + +```ts +type EqualsUnit = + | "year" + | "month" + | "week" + | "day" + | "hour" + | "minute" + | "second" + | "millisecond"; +``` + +Defined in: [date/equals/equals.ts:6](https://github.com/TanStack/time/blob/main/packages/time/src/date/equals/equals.ts#L6) diff --git a/docs/reference/type-aliases/EventDateTimeInput.md b/docs/reference/type-aliases/EventDateTimeInput.md new file mode 100644 index 00000000..b7043b47 --- /dev/null +++ b/docs/reference/type-aliases/EventDateTimeInput.md @@ -0,0 +1,12 @@ +--- +id: EventDateTimeInput +title: EventDateTimeInput +--- + +# Type Alias: EventDateTimeInput + +```ts +type EventDateTimeInput = string | Date | number; +``` + +Defined in: [calendar/types.ts:4](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L4) diff --git a/docs/reference/type-aliases/FormatType.md b/docs/reference/type-aliases/FormatType.md new file mode 100644 index 00000000..3d72d75f --- /dev/null +++ b/docs/reference/type-aliases/FormatType.md @@ -0,0 +1,12 @@ +--- +id: FormatType +title: FormatType +--- + +# Type Alias: FormatType + +```ts +type FormatType = "date" | "time" | "datetime"; +``` + +Defined in: [date/format/format.ts:14](https://github.com/TanStack/time/blob/main/packages/time/src/date/format/format.ts#L14) diff --git a/docs/reference/type-aliases/GroupDaysByProps.md b/docs/reference/type-aliases/GroupDaysByProps.md new file mode 100644 index 00000000..1f5551b4 --- /dev/null +++ b/docs/reference/type-aliases/GroupDaysByProps.md @@ -0,0 +1,24 @@ +--- +id: GroupDaysByProps +title: GroupDaysByProps +--- + +# Type Alias: GroupDaysByProps\ + +```ts +type GroupDaysByProps = + | GroupDaysByMonthProps +| GroupDaysByWeekProps; +``` + +Defined in: [calendar/groupDaysBy.ts:30](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/groupDaysBy.ts#L30) + +## Type Parameters + +### TResource + +`TResource` *extends* [`Resource`](../interfaces/Resource.md) + +### TEvent + +`TEvent` *extends* [`Event`](../interfaces/Event.md)\<`TResource`\> = [`Event`](../interfaces/Event.md)\<`TResource`\> diff --git a/docs/reference/type-aliases/IsSameOrAfterUnit.md b/docs/reference/type-aliases/IsSameOrAfterUnit.md new file mode 100644 index 00000000..3c795455 --- /dev/null +++ b/docs/reference/type-aliases/IsSameOrAfterUnit.md @@ -0,0 +1,20 @@ +--- +id: IsSameOrAfterUnit +title: IsSameOrAfterUnit +--- + +# Type Alias: IsSameOrAfterUnit + +```ts +type IsSameOrAfterUnit = + | "year" + | "month" + | "week" + | "day" + | "hour" + | "minute" + | "second" + | "millisecond"; +``` + +Defined in: [date/isSameOrAfter/isSameOrAfter.ts:7](https://github.com/TanStack/time/blob/main/packages/time/src/date/isSameOrAfter/isSameOrAfter.ts#L7) diff --git a/docs/reference/type-aliases/IsSameOrBeforeUnit.md b/docs/reference/type-aliases/IsSameOrBeforeUnit.md new file mode 100644 index 00000000..7552ceb0 --- /dev/null +++ b/docs/reference/type-aliases/IsSameOrBeforeUnit.md @@ -0,0 +1,20 @@ +--- +id: IsSameOrBeforeUnit +title: IsSameOrBeforeUnit +--- + +# Type Alias: IsSameOrBeforeUnit + +```ts +type IsSameOrBeforeUnit = + | "year" + | "month" + | "week" + | "day" + | "hour" + | "minute" + | "second" + | "millisecond"; +``` + +Defined in: [date/isSameOrBefore/isSameOrBefore.ts:7](https://github.com/TanStack/time/blob/main/packages/time/src/date/isSameOrBefore/isSameOrBefore.ts#L7) diff --git a/docs/reference/type-aliases/RecurrenceEditScope.md b/docs/reference/type-aliases/RecurrenceEditScope.md new file mode 100644 index 00000000..b761e844 --- /dev/null +++ b/docs/reference/type-aliases/RecurrenceEditScope.md @@ -0,0 +1,14 @@ +--- +id: RecurrenceEditScope +title: RecurrenceEditScope +--- + +# Type Alias: RecurrenceEditScope + +```ts +type RecurrenceEditScope = "this" | "thisAndFollowing" | "all"; +``` + +Defined in: [calendar/types.ts:19](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L19) + +Scope used when editing/removing a recurring event series. diff --git a/docs/reference/type-aliases/RecurrenceFrequency.md b/docs/reference/type-aliases/RecurrenceFrequency.md new file mode 100644 index 00000000..c9b2d7fc --- /dev/null +++ b/docs/reference/type-aliases/RecurrenceFrequency.md @@ -0,0 +1,14 @@ +--- +id: RecurrenceFrequency +title: RecurrenceFrequency +--- + +# Type Alias: RecurrenceFrequency + +```ts +type RecurrenceFrequency = "daily" | "weekly" | "monthly" | "yearly"; +``` + +Defined in: [calendar/types.ts:7](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L7) + +How often a recurring event repeats. diff --git a/docs/reference/type-aliases/ResizeEdge.md b/docs/reference/type-aliases/ResizeEdge.md new file mode 100644 index 00000000..7bb627f3 --- /dev/null +++ b/docs/reference/type-aliases/ResizeEdge.md @@ -0,0 +1,12 @@ +--- +id: ResizeEdge +title: ResizeEdge +--- + +# Type Alias: ResizeEdge + +```ts +type ResizeEdge = "top" | "bottom" | "left" | "right"; +``` + +Defined in: [calendar/getResizeProps.ts:3](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/getResizeProps.ts#L3) diff --git a/docs/reference/type-aliases/ResizeListener.md b/docs/reference/type-aliases/ResizeListener.md new file mode 100644 index 00000000..286c0fd5 --- /dev/null +++ b/docs/reference/type-aliases/ResizeListener.md @@ -0,0 +1,16 @@ +--- +id: ResizeListener +title: ResizeListener +--- + +# Type Alias: ResizeListener() + +```ts +type ResizeListener = () => void; +``` + +Defined in: [calendar/resizeController.ts:63](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/resizeController.ts#L63) + +## Returns + +`void` diff --git a/docs/reference/type-aliases/RoundUnit.md b/docs/reference/type-aliases/RoundUnit.md new file mode 100644 index 00000000..c6f6620b --- /dev/null +++ b/docs/reference/type-aliases/RoundUnit.md @@ -0,0 +1,19 @@ +--- +id: RoundUnit +title: RoundUnit +--- + +# Type Alias: RoundUnit + +```ts +type RoundUnit = + | "day" + | "hour" + | "minute" + | "second" + | "millisecond" + | "microsecond" + | "nanosecond"; +``` + +Defined in: [date/round/round.ts:6](https://github.com/TanStack/time/blob/main/packages/time/src/date/round/round.ts#L6) diff --git a/docs/reference/type-aliases/SaveEventResult.md b/docs/reference/type-aliases/SaveEventResult.md new file mode 100644 index 00000000..e14b7e5b --- /dev/null +++ b/docs/reference/type-aliases/SaveEventResult.md @@ -0,0 +1,21 @@ +--- +id: SaveEventResult +title: SaveEventResult +--- + +# Type Alias: SaveEventResult + +```ts +type SaveEventResult = + | { + success: true; +} + | { + error: ResizeError; + success: false; +}; +``` + +Defined in: [calendar/types.ts:247](https://github.com/TanStack/time/blob/main/packages/time/src/calendar/types.ts#L247) + +Result of a CalendarActions.saveEvent call. diff --git a/docs/reference/type-aliases/StartOfUnit.md b/docs/reference/type-aliases/StartOfUnit.md new file mode 100644 index 00000000..50b40116 --- /dev/null +++ b/docs/reference/type-aliases/StartOfUnit.md @@ -0,0 +1,20 @@ +--- +id: StartOfUnit +title: StartOfUnit +--- + +# Type Alias: StartOfUnit + +```ts +type StartOfUnit = + | "year" + | "month" + | "week" + | "day" + | "hour" + | "minute" + | "second" + | "millisecond"; +``` + +Defined in: [date/startOf/startOf.ts:5](https://github.com/TanStack/time/blob/main/packages/time/src/date/startOf/startOf.ts#L5) diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 00000000..b97eeed3 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,23 @@ +// @ts-check + +// @ts-ignore Needed due to moduleResolution Node vs Bundler +import { tanstackConfig } from '@tanstack/eslint-config' +import unusedImports from 'eslint-plugin-unused-imports' + +/** @type {import('eslint').Linter.Config[]} */ +export default [ + ...tanstackConfig, + { + name: 'tanstack/temp', + plugins: { + 'unused-imports': unusedImports, + }, + rules: { + 'no-case-declarations': 'off', + 'no-shadow': 'off', + 'unused-imports/no-unused-imports': 'warn', + 'pnpm/enforce-catalog': 'off', + 'pnpm/json-enforce-catalog': 'off', + }, + }, +] diff --git a/examples/react/calendar/components.json b/examples/react/calendar/components.json new file mode 100644 index 00000000..f5ebd862 --- /dev/null +++ b/examples/react/calendar/components.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://ui.shadcn.com/schema.json", + "style": "base-nova", + "rsc": false, + "tsx": true, + "tailwind": { + "config": "tailwind.config.js", + "css": "src/index.css", + "baseColor": "neutral", + "cssVariables": true, + "prefix": "" + }, + "iconLibrary": "lucide", + "rtl": false, + "aliases": { + "components": "@/components", + "utils": "@/lib/utils", + "ui": "@/components/ui", + "lib": "@/lib", + "hooks": "@/hooks" + }, + "menuColor": "default", + "menuAccent": "subtle", + "registries": {} +} diff --git a/examples/react/calendar/index.html b/examples/react/calendar/index.html new file mode 100644 index 00000000..4615473f --- /dev/null +++ b/examples/react/calendar/index.html @@ -0,0 +1,14 @@ + + + + + + + TanStack Time - React Basic Example + + + +
+ + + diff --git a/examples/react/calendar/package.json b/examples/react/calendar/package.json new file mode 100644 index 00000000..43097400 --- /dev/null +++ b/examples/react/calendar/package.json @@ -0,0 +1,37 @@ +{ + "name": "@tanstack/time-example-react-basic", + "private": true, + "type": "module", + "scripts": { + "dev": "vite --port=3005", + "build": "vite build", + "preview": "vite preview", + "test:types": "tsc" + }, + "dependencies": { + "@base-ui/react": "^1.3.0", + "@fontsource-variable/geist": "^5.2.8", + "@tanstack/react-devtools": "^0.9.5", + "@tanstack/react-time": "^0.0.0", + "@tanstack/react-time-devtools": "^0.0.0", + "@tanstack/time": "^0.0.0", + "class-variance-authority": "^0.7.1", + "clsx": "^2.1.1", + "lucide-react": "^1.8.0", + "react": "^19.2.3", + "react-dom": "^19.2.3", + "shadcn": "^4.2.0", + "tailwind-merge": "^3.5.0", + "tw-animate-css": "^1.4.0" + }, + "devDependencies": { + "@types/react": "^19.2.8", + "@types/react-dom": "^19.2.3", + "@vitejs/plugin-react": "^5.1.2", + "autoprefixer": "^10.4.20", + "postcss": "^8.4.49", + "tailwindcss": "^3.4.17", + "typescript": "5.9.3", + "vite": "^7.3.1" + } +} diff --git a/examples/react/calendar/postcss.config.js b/examples/react/calendar/postcss.config.js new file mode 100644 index 00000000..2e7af2b7 --- /dev/null +++ b/examples/react/calendar/postcss.config.js @@ -0,0 +1,6 @@ +export default { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} diff --git a/examples/react/calendar/src/components/ui/badge.tsx b/examples/react/calendar/src/components/ui/badge.tsx new file mode 100644 index 00000000..83b3ed7d --- /dev/null +++ b/examples/react/calendar/src/components/ui/badge.tsx @@ -0,0 +1,52 @@ +import { mergeProps } from '@base-ui/react/merge-props' +import { useRender } from '@base-ui/react/use-render' +import { cva, type VariantProps } from 'class-variance-authority' + +import { cn } from '@/lib/utils' + +const badgeVariants = cva( + 'group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!', + { + variants: { + variant: { + default: 'bg-primary text-primary-foreground [a]:hover:bg-primary/80', + secondary: + 'bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80', + destructive: + 'bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20', + outline: + 'border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground', + ghost: + 'hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50', + link: 'text-primary underline-offset-4 hover:underline', + }, + }, + defaultVariants: { + variant: 'default', + }, + }, +) + +function Badge({ + className, + variant = 'default', + render, + ...props +}: useRender.ComponentProps<'span'> & VariantProps) { + return useRender({ + defaultTagName: 'span', + props: mergeProps<'span'>( + { + className: cn(badgeVariants({ variant }), className), + }, + props, + ), + render, + state: { + slot: 'badge', + variant, + }, + }) +} + +export { Badge, badgeVariants } diff --git a/examples/react/calendar/src/components/ui/button.tsx b/examples/react/calendar/src/components/ui/button.tsx new file mode 100644 index 00000000..b520e871 --- /dev/null +++ b/examples/react/calendar/src/components/ui/button.tsx @@ -0,0 +1,58 @@ +import { Button as ButtonPrimitive } from '@base-ui/react/button' +import { cva, type VariantProps } from 'class-variance-authority' + +import { cn } from '@/lib/utils' + +const buttonVariants = cva( + "group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", + { + variants: { + variant: { + default: 'bg-primary text-primary-foreground [a]:hover:bg-primary/80', + outline: + 'border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50', + secondary: + 'bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground', + ghost: + 'hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50', + destructive: + 'bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40', + link: 'text-primary underline-offset-4 hover:underline', + }, + size: { + default: + 'h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2', + xs: "h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3", + sm: "h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5", + lg: 'h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2', + icon: 'size-8', + 'icon-xs': + "size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3", + 'icon-sm': + 'size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg', + 'icon-lg': 'size-9', + }, + }, + defaultVariants: { + variant: 'default', + size: 'default', + }, + }, +) + +function Button({ + className, + variant = 'default', + size = 'default', + ...props +}: ButtonPrimitive.Props & VariantProps) { + return ( + + ) +} + +export { Button, buttonVariants } diff --git a/examples/react/calendar/src/components/ui/card.tsx b/examples/react/calendar/src/components/ui/card.tsx new file mode 100644 index 00000000..496806ea --- /dev/null +++ b/examples/react/calendar/src/components/ui/card.tsx @@ -0,0 +1,103 @@ +import * as React from 'react' + +import { cn } from '@/lib/utils' + +function Card({ + className, + size = 'default', + ...props +}: React.ComponentProps<'div'> & { size?: 'default' | 'sm' }) { + return ( +
img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl', + className, + )} + {...props} + /> + ) +} + +function CardHeader({ className, ...props }: React.ComponentProps<'div'>) { + return ( +
+ ) +} + +function CardTitle({ className, ...props }: React.ComponentProps<'div'>) { + return ( +
+ ) +} + +function CardDescription({ className, ...props }: React.ComponentProps<'div'>) { + return ( +
+ ) +} + +function CardAction({ className, ...props }: React.ComponentProps<'div'>) { + return ( +
+ ) +} + +function CardContent({ className, ...props }: React.ComponentProps<'div'>) { + return ( +
+ ) +} + +function CardFooter({ className, ...props }: React.ComponentProps<'div'>) { + return ( +
+ ) +} + +export { + Card, + CardHeader, + CardFooter, + CardTitle, + CardAction, + CardDescription, + CardContent, +} diff --git a/examples/react/calendar/src/components/ui/context-menu.tsx b/examples/react/calendar/src/components/ui/context-menu.tsx new file mode 100644 index 00000000..90c213b1 --- /dev/null +++ b/examples/react/calendar/src/components/ui/context-menu.tsx @@ -0,0 +1,270 @@ +import * as React from 'react' +import { ContextMenu as ContextMenuPrimitive } from '@base-ui/react/context-menu' + +import { cn } from '@/lib/utils' +import { ChevronRightIcon, CheckIcon } from 'lucide-react' + +function ContextMenu({ ...props }: ContextMenuPrimitive.Root.Props) { + return +} + +function ContextMenuPortal({ ...props }: ContextMenuPrimitive.Portal.Props) { + return ( + + ) +} + +function ContextMenuTrigger({ + className, + ...props +}: ContextMenuPrimitive.Trigger.Props) { + return ( + + ) +} + +function ContextMenuContent({ + className, + align = 'start', + alignOffset = 4, + side = 'right', + sideOffset = 0, + ...props +}: ContextMenuPrimitive.Popup.Props & + Pick< + ContextMenuPrimitive.Positioner.Props, + 'align' | 'alignOffset' | 'side' | 'sideOffset' + >) { + return ( + + + + + + ) +} + +function ContextMenuGroup({ ...props }: ContextMenuPrimitive.Group.Props) { + return ( + + ) +} + +function ContextMenuLabel({ + className, + inset, + ...props +}: ContextMenuPrimitive.GroupLabel.Props & { + inset?: boolean +}) { + return ( + + ) +} + +function ContextMenuItem({ + className, + inset, + variant = 'default', + ...props +}: ContextMenuPrimitive.Item.Props & { + inset?: boolean + variant?: 'default' | 'destructive' +}) { + return ( + + ) +} + +function ContextMenuSub({ ...props }: ContextMenuPrimitive.SubmenuRoot.Props) { + return ( + + ) +} + +function ContextMenuSubTrigger({ + className, + inset, + children, + ...props +}: ContextMenuPrimitive.SubmenuTrigger.Props & { + inset?: boolean +}) { + return ( + + {children} + + + ) +} + +function ContextMenuSubContent({ + ...props +}: React.ComponentProps) { + return ( + + ) +} + +function ContextMenuCheckboxItem({ + className, + children, + checked, + inset, + ...props +}: ContextMenuPrimitive.CheckboxItem.Props & { + inset?: boolean +}) { + return ( + + + + + + + {children} + + ) +} + +function ContextMenuRadioGroup({ + ...props +}: ContextMenuPrimitive.RadioGroup.Props) { + return ( + + ) +} + +function ContextMenuRadioItem({ + className, + children, + inset, + ...props +}: ContextMenuPrimitive.RadioItem.Props & { + inset?: boolean +}) { + return ( + + + + + + + {children} + + ) +} + +function ContextMenuSeparator({ + className, + ...props +}: ContextMenuPrimitive.Separator.Props) { + return ( + + ) +} + +function ContextMenuShortcut({ + className, + ...props +}: React.ComponentProps<'span'>) { + return ( + + ) +} + +export { + ContextMenu, + ContextMenuTrigger, + ContextMenuContent, + ContextMenuItem, + ContextMenuCheckboxItem, + ContextMenuRadioItem, + ContextMenuLabel, + ContextMenuSeparator, + ContextMenuShortcut, + ContextMenuGroup, + ContextMenuPortal, + ContextMenuSub, + ContextMenuSubContent, + ContextMenuSubTrigger, + ContextMenuRadioGroup, +} diff --git a/examples/react/calendar/src/components/ui/dialog.tsx b/examples/react/calendar/src/components/ui/dialog.tsx new file mode 100644 index 00000000..f160efd2 --- /dev/null +++ b/examples/react/calendar/src/components/ui/dialog.tsx @@ -0,0 +1,157 @@ +import * as React from 'react' +import { Dialog as DialogPrimitive } from '@base-ui/react/dialog' + +import { cn } from '@/lib/utils' +import { Button } from '@/components/ui/button' +import { XIcon } from 'lucide-react' + +function Dialog({ ...props }: DialogPrimitive.Root.Props) { + return +} + +function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props) { + return +} + +function DialogPortal({ ...props }: DialogPrimitive.Portal.Props) { + return +} + +function DialogClose({ ...props }: DialogPrimitive.Close.Props) { + return +} + +function DialogOverlay({ + className, + ...props +}: DialogPrimitive.Backdrop.Props) { + return ( + + ) +} + +function DialogContent({ + className, + children, + showCloseButton = true, + ...props +}: DialogPrimitive.Popup.Props & { + showCloseButton?: boolean +}) { + return ( + + + + {children} + {showCloseButton && ( + + } + > + + Close + + )} + + + ) +} + +function DialogHeader({ className, ...props }: React.ComponentProps<'div'>) { + return ( +
+ ) +} + +function DialogFooter({ + className, + showCloseButton = false, + children, + ...props +}: React.ComponentProps<'div'> & { + showCloseButton?: boolean +}) { + return ( +
+ {children} + {showCloseButton && ( + }> + Close + + )} +
+ ) +} + +function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) { + return ( + + ) +} + +function DialogDescription({ + className, + ...props +}: DialogPrimitive.Description.Props) { + return ( + + ) +} + +export { + Dialog, + DialogClose, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogOverlay, + DialogPortal, + DialogTitle, + DialogTrigger, +} diff --git a/examples/react/calendar/src/components/ui/input.tsx b/examples/react/calendar/src/components/ui/input.tsx new file mode 100644 index 00000000..9def7819 --- /dev/null +++ b/examples/react/calendar/src/components/ui/input.tsx @@ -0,0 +1,20 @@ +import * as React from 'react' +import { Input as InputPrimitive } from '@base-ui/react/input' + +import { cn } from '@/lib/utils' + +function Input({ className, type, ...props }: React.ComponentProps<'input'>) { + return ( + + ) +} + +export { Input } diff --git a/examples/react/calendar/src/components/ui/label.tsx b/examples/react/calendar/src/components/ui/label.tsx new file mode 100644 index 00000000..9c50830b --- /dev/null +++ b/examples/react/calendar/src/components/ui/label.tsx @@ -0,0 +1,20 @@ +'use client' + +import * as React from 'react' + +import { cn } from '@/lib/utils' + +function Label({ className, ...props }: React.ComponentProps<'label'>) { + return ( +