date-operations

Standardizes TypeScript date handling using the date-fns library.

Updated Dec 21, 2025
One-click install
npx skills add https://github.com/Angael/veles --skill date-operations-angael
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: date-operations
Source: https://github.com/Angael/veles/tree/main/.agents/skills/date-operations
Command: npx skills add https://github.com/Angael/veles --skill date-operations-angael

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires date-fns.

What problem does it solve? Inconsistent date handling in TypeScript projects leads to fragile custom helpers, manual calculations, and subtle bugs around formatting, arithmetic, and timezones. This Skill enforces a single, well-tested approach for all date operations. ## Core Features & Use Cases - Standardized Library Usage: Directs all date operations to date-fns instead of ad-hoc helpers or manual calculations. - Documentation Guidance: Points to the official date-fns documentation when behavior is unclear, reducing guesswork. - Use Case: When adding a feature that computes a subscription renewal date or formats timestamps in a TanStack Start app, use date-fns functions like addDays or format rather than writing custom date math. ## Quick Start Ask the AI to implement or refactor date logic in your TypeScript code using date-fns instead of custom helpers.

Frequently Asked Questions about date-operations

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle dates in TypeScript projects?

Use the date-fns library for all date operations in TypeScript rather than writing custom helpers or manual calculations. It provides tested functions for formatting, arithmetic, parsing, and comparison with strong TypeScript support.

What library should I use for date formatting in TypeScript?

date-fns is the recommended choice for date formatting and manipulation in TypeScript. It offers modular, tree-shakeable functions like format, addDays, and differenceInDays, avoiding the pitfalls of hand-rolled date logic.

date-fns vs custom date helpers, which is better?

date-fns is preferable to custom helpers because it is maintained, tested across edge cases like month boundaries and leap years, and documented. Custom helpers often contain subtle bugs and duplicate functionality the library already provides.

Where can I check date-fns behavior when it is unclear?

Consult the official date-fns documentation at https://date-fns.org/docs/Getting-Started when function behavior is unclear. The docs detail each function's arguments, return values, and edge-case handling.

When should I avoid manual date calculations in JavaScript?

Avoid manual date calculations whenever a library function exists, since native Date arithmetic mishandles month lengths, daylight saving transitions, and timezone offsets. Use date-fns functions for any non-trivial date logic.