| name | dayjs-1-11-0 |
| description | Complete toolkit for date and time manipulation using Day.js 1.11, a minimalist 2kB library with Moment.js-compatible API. Use when parsing, validating, manipulating, and displaying dates in JavaScript applications requiring immutable operations, i18n support, and plugin extensibility. |
| version | 0.1.0 |
| author | Tangled <noreply@tangledgroup.com> |
| license | MIT |
| tags | ["date","time","parsing","formatting","manipulation","i18n","plugins","immutable"] |
| category | utilities |
| external_references | ["https://day.js.org/","https://github.com/iamkun/dayjs"] |
Day.js 1.11
Overview
Day.js is a minimalist 2kB JavaScript library that parses, validates, manipulates, and displays dates and times for modern browsers and Node.js. It provides a largely Moment.js-compatible API while being immutable, chainable, and tree-shakeable. The core library ships with no plugins — functionality is extended on demand via a plugin system. Locales are loaded individually, keeping bundle size minimal.
Key characteristics:
- 2kB gzipped — significantly smaller than Moment.js (~30kB)
- Immutable — all mutating operations return new instances
- Chainable — fluent API for composed date operations
- I18n — 80+ locales, loaded on demand (none included by default)
- Plugin architecture — 30+ official plugins, extend only what you need
- Moment.js-compatible API — drop-in replacement patterns
import dayjs from 'dayjs'
dayjs('2018-08-08')
dayjs().format('YYYY-MM-DD HH:mm:ss')
dayjs().set('month', 3).month()
dayjs().add(1, 'year')
dayjs().isBefore(dayjs())
When to Use
- Parsing date strings, timestamps, or Date objects into a manipulable format
- Formatting dates for display (ISO 8601, custom patterns, localized output)
- Adding, subtracting, or comparing dates and times
- Getting or setting individual date components (year, month, day, hour, etc.)