date-fns
Skill1 starsChanged 3 months agoMITView on GitHub
Build, review, debug, migrate, or plan date-fns v4 date/time code with @date-fns/tz and @date-fns/utc. Use for date-fns, format, parse, parseISO, addDays, differenceIn*, Interval, Duration, date-fns/fp, locales, TZDate, UTCDate, tz(), utc, transpose, in option, Unicode tokens, DST, SSR hydration date bugs, and migrations from date-fns v2/v3 or date-fns-tz.
In this repository81 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agents-mdSkill
- base-uiSkill
- better-authSkill
- brainstormSkill
- bullmqSkill
- bunSkill
- clickhouseSkill
- clone-to-tempSkill
- compound-uiSkill
- copywritingSkill
- create-durable-planSkill
- d3Skill
- decimal-jsSkill
- deduplicateSkill
- design-engineerSkill
- designSkill
- drizzle-ormSkill
- effectSkill
- elysia-architectureSkill
- elysiaSkill
- evlogSkill
- feedsmithSkill
- grokSkill
- handoffSkill
- heyapiSkill
- impitSkill
- intlayerSkill
- jsdocSkill
- kafkaSkill
- kill-legacySkill
- legend-stateSkill
- loopSkill
- mantine-hooksSkill
- mobbinSkill
- motionSkill
- oxfmtSkill
- oxlintSkill
- permixSkill
- plain-languageSkill
- playwrightSkill
- react-boundariesSkill
- react-emailSkill
- reactSkill
- reorganizeSkill
- researchSkill
- schema-dtsSkill
- sentrySkill
- seoSkill
- setup-competitors-mdSkill
- setup-copywriting-mdSkill
- setup-icp-mdSkill
- setup-project-mdSkill
- simplify-layoutSkill
- storybookSkill
- subagentsSkill
- tailwindSkill
- tailwind-variantsSkill
- takumiSkill
- tanstack-chartsSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 2 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 8
Use this skill for date-fns v4 date math, formatting, parsing, FP mode, locales, and official timezone packages @date-fns/tz / …
- Very specific: line 21
Add/set/boundaries, diffs, Interval, Duration: manipulate-compare.md.
- Distinctive: line 26
Verify with typecheck plus focused tests for Invalid Date, calendar vs elapsed diffs, and zone/SSR edges when relevant.
- Very specific: line 47
Prefer named imports. Constants come from "date-fns/constants", not the main barrel.
- Very specific: line 48
Always isValid before format — format throws RangeError on Invalid Date.
- Very specific: line 51
Prefer differenceInCalendar* for calendar-day questions.
- Very specific: line 54
Prefer full TZDate / UTCDate at library boundaries.
- Very specific: line 55
Do not confuse @date-fns/tz with third-party date-fns-tz.
- Distinctive: line 59
Prefer repository-owned commands.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
date-fns
Use this skill for date-fns v4 date math, formatting, parsing, FP mode, locales, and official timezone packages @date-fns/tz / @date-fns/utc.
Workflow
- Inspect the local surface before changing code:
- Packages:
date-fns, optional@date-fns/tz,@date-fns/utc(and legacydate-fns-tzif present). - Versions: prefer date-fns ≥ 4 for first-class
{ in }/TZDate/UTCDateinterop. v3 is common but local-only unless usingdate-fns-tz. - Zone intent: system-local UI, UTC-normalized server math, or named IANA zones (user/venue/HQ).
- Imports: named from
"date-fns","date-fns/fp","date-fns/locale/*","date-fns/constants".
- Packages:
- Refresh docs when versions are unclear or work touches timezones, Unicode tokens, SSR, or major upgrades. Start from source-map.md.
- Route deeper detail:
- Install, imports, core concepts, Invalid Date: setup-core.md.
format/parse/parseISO, Unicode tokens: format-parse.md.- Add/set/boundaries, diffs, Interval, Duration: manipulate-compare.md.
TZDate,UTCDate,tz/utc,transpose, DST, SSR: timezones.md.- FP, locales, TypeScript: fp-locales-types.md.
- v2→v3→v4 and
date-fns-tzmigration: migration-pitfalls.md.
- Match the project's installed major and existing import style. Do not add
@date-fns/tzor@date-fns/utcunless zone semantics require them. - Verify with typecheck plus focused tests for Invalid Date, calendar vs elapsed diffs, and zone/SSR edges when relevant.
Zone Decision Tree
System-local calendar / host TZ only?
→ plain Date + date-fns
UTC-only math (server day, charts, no IANA zones)?
→ @date-fns/utc (UTCDate / UTCDateMini or { in: utc })
Named IANA zone or multi-zone product?
→ @date-fns/tz (TZDate / TZDateMini or { in: tz("…") })
Stuck on date-fns v3?
→ upgrade to v4 + official packages, or use legacy date-fns-tz until thenCore Judgment
- Bare date-fns is system-local, not a UTC library. Use
@date-fns/utcor@date-fns/tzfor non-local calendar fields. - Prefer named imports. Constants come from
"date-fns/constants", not the main barrel. - Always
isValidbeforeformat—formatthrowsRangeErroron Invalid Date. - Unicode tokens: use
yyyy-MM-dd, never Moment-styleYYYY-MM-DD/DD(week-year / day-of-year). See format-parse.md. parseISO("YYYY-MM-DD")→ local midnight;new Date("YYYY-MM-DD")→ UTC midnight. Do not conflate.- Prefer
differenceInCalendar*for calendar-day questions;differenceIn*for elapsed full units. - With mixed zones or primitives, pin context with
{ in: tz("…") }or{ in: utc }— first objectDate/extension argument otherwise wins and order can flip day math. new TZDate(iso, zone)≠ legacytoZonedTime. Same instant, different wall clock. Wall-clock remapping usestranspose.- Prefer full
TZDate/UTCDateat library boundaries; Mini variants skip zone-awaretoString/ locale formatters (system-zone leak). - Do not confuse
@date-fns/tzwith third-partydate-fns-tz.
Verification
Prefer repository-owned commands. Cover the relevant subset:
bun pm ls date-fns @date-fns/tz @date-fns/utc(anddate-fns-tzif migrating).- Typecheck for
DateArg, options types, and extension return types. - Tests: valid/invalid parse, Unicode tokens, calendar vs elapsed diffs, reversed intervals, DST spring-forward/fall-back,
{ in }vs argument-order zone selection. - SSR/hydration smoke when formatting “today” or local day boundaries across server (often UTC) and client (local).
Report which checks ran, which did not, and version assumptions that remain.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

