dayjs

Document Day.js parsing, formatting, manipulation, and relative time usage.

Updated Mar 24, 2026
One-click install
npx skills add https://github.com/trusted-american/marketplace --skill dayjs-trusted-american
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dayjs
Source: https://github.com/trusted-american/marketplace/tree/main/plugins/a3-plugin/skills/dayjs
Command: npx skills add https://github.com/trusted-american/marketplace --skill dayjs-trusted-american

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Day.js provides a lightweight, composable date/time library for parsing, formatting, and manipulating dates in JavaScript applications, serving as a comprehensive reference for A3 projects.

Core Features & Use Cases

  • Parsing dates from ISO strings, Date objects, timestamps, and Firestore-like structures.
  • Formatting dates with a wide range of tokens, including relative time and timezone support via plugins.
  • Manipulating dates (add/subtract, startOf/endOf, getters) and performing comparisons for UI displays, data queries, and scheduling.
  • Integrating UTC and timezone handling to display times in user local time or specific zones across frontend and cloud functions.

Quick Start

Install Day.js in your project and import it to format dates, set up plugins as needed.

Frequently Asked Questions about dayjs

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

FAQPage Schema
How do I parse and format dates from Firestore timestamps in JavaScript?

Day.js handles date parsing and formatting for Firestore-like timestamp structures by converting them into readable strings. You import the library, pass the timestamp object to it, and apply formatting tokens to display the desired output.

What's the best way to handle timezone-aware date displays across frontend and cloud functions?

Handling timezone-aware date displays is achieved by loading the Day.js UTC and timezone plugins. These plugins allow you to parse, shift, and display times accurately across frontend and cloud function environments.

How does relative time formatting work in JavaScript date libraries?

Relative time formatting works by calculating the duration between a target date and the current time, outputting phrases like 'hours ago'. Day.js enables this through its relativeTime plugin, which defines the threshold and translation rules.

Can I manipulate and compare dates for scheduling logic without Moment.js?

Yes, you can manipulate and compare dates for scheduling logic using Day.js as a lightweight alternative. It provides add, subtract, startOf, and endOf methods alongside comparison operators to evaluate date sequences.

Do I need to install plugins to parse ISO strings and Date objects?

No, you do not need plugins to parse ISO strings and native Date objects, as Day.js core supports them directly. Plugins are required for extended features like UTC and timezone operations.