Implements modular, tree-shakeable date manipulation and formatting patterns using date-fns for TypeScript environments.
This skill provides specialized guidance for using date-fns, the functional and modular date utility library, within TypeScript projects. It enforces best practices such as immutable date operations, safe ISO parsing, and tree-shakeable imports to minimize bundle sizes. Whether you are handling complex timezones with @date-fns/tz, generating localized date strings, or performing precise date arithmetic, this skill ensures your implementation follows modern standards and avoids common pitfalls like browser-inconsistent native Date parsing and side-effect-prone mutations.
主要功能
01Comprehensive timezone handling for both date-fns v3 and v4 (@date-fns/tz)
02Safe ISO 8601 parsing and validation using parseISO and isValid
030 GitHub stars
04Modular, tree-shakeable imports to optimize production bundle sizes
05Locale-aware formatting and internationalization support using Unicode tokens
06Pure, functional date arithmetic and semantic comparison utilities
使用场景
01Building internationalized calendar and scheduling components with locale support
02Implementing precise billing cycles and trial period logic using date arithmetic
03Formatting human-readable relative timestamps and smart date displays