sdxc-dates

Formats, parses, and computes calendar dates with Intl and explicit time zones.

5|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/sergiodxa/monorepo --skill sdxc-dates-sergiodxa
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: sdxc-dates
Source: https://github.com/sergiodxa/monorepo/tree/main/.agents/skills/sdxc-dates
Command: npx skills add https://github.com/sergiodxa/monorepo --skill sdxc-dates-sergiodxa

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Date handling breaks when time zones are implicit, locale formatting is inconsistent, or invalid strings silently produce Invalid Date objects. This Skill documents the @sdxc/dates package, which forces every calendar question to name its IANA time zone, formats every human-facing string through Intl, and returns Result types from parsers instead of throwing. ## Core Features & Use Cases - Locale-aware formatting: formatDate, formatTime, formatRelative, formatDuration, and formatParts render timestamps through cached Intl formatters for any locale and zone. - Calendar math and day grids: startOfDay, endOfDay, diffInDays, eachDayOfInterval, daysOfYear, lastNDays, and groupByWeek build day buckets, month views, and rolling N-day windows aligned to the reader's calendar. - Safe parsing and day keys: toDayKey and fromDayKey convert between instants and YYYY-MM-DD segments, while parseDate and parseDayKey return Result values instead of Invalid Date. - Use Case: When bucketing activity rows by day for a contribution graph, group on toDayKey with the reader's zone so each cell lands on their calendar rather than the server's. ## Quick Start Add @sdxc/dates as a workspace dependency and ask the agent to format a timestamp for a reader in a specific locale and IANA time zone using formatDate or formatRelative.

Frequently Asked Questions about sdxc-dates

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

FAQPage Schema
How do I format a date for a specific time zone in JavaScript?▼

Use formatDate or formatTime from @sdxc/dates with an explicit locale and IANA timeZone option, such as America/New_York. The package routes every human-facing string through cached Intl formatters, so output always reflects the stated zone and locale.

How to group rows by calendar day instead of UTC day?▼

Group aggregations on toDayKey(instant, timeZone) rather than a truncated timestamp. This buckets each row by the reader's calendar day, and grid cells from lastNDays or daysOfYear can be looked up by their day.key in constant time.

Does @sdxc/dates work outside Node.js, like on Cloudflare Workers?▼

Yes, the package runs on any runtime that provides Intl, which includes Cloudflare Workers, modern browsers, Node, and Bun. It builds on the platform Date and Intl APIs with no native dependencies.

Why does date parsing return a Result instead of a Date?▼

parseDate, parseDayKey, and fromDayKey return a Result from @sdxc/result so invalid input can never produce a silent Invalid Date. Callers handle the failure branch explicitly instead of discovering NaN timestamps downstream.

When should I use fromDayKey instead of parseDate?▼

Use fromDayKey when the input names a calendar day, such as a YYYY-MM-DD segment from a URL, because it resolves the day's first instant in a named time zone. parseDate reads a date-only string as UTC midnight, which shifts the day in most zones.