DayJS Date Library

DayJS Date Library

day.js.org

1

About this website

DayJS is a minimalist JavaScript date library created by iamkun in 2018, providing an immutable, chainable, and lightweight alternative to MomentJS with a nearly identical API, weighing only two kilobytes minified and gzried compared to MomentJS at over sixty-seven kilobytes, designed for modern web applications where bundle size matters, supporting parsing, formatting, manipulation, comparison, duration, relative time, timezone, quarter, ISO week, and localization through plugin extensions, with a chainable API that mirrors MomentJS for easy migration, adopted by over one hundred thousand npm packages and millions of websites for their date and time handling. The core API provides parsing through the dayjs function accepting ISO 8601 strings, Unix timestamps, Date objects, and arrays, with formatting through the format method using tokens including year, month, day, hour, minute, second, and timezone, and manipulation through methods including add, subtract, startOf, endOf, and set for immutable operations that return new instances without modifying the original. The plugin system extends functionality without bloating the core library, with official plugins including timezone for timezone-aware date handling, duration for time span calculations, relativeTime for human-readable relative dates, quarter for fiscal quarter support, weekOfYear for ISO week numbers, customParseFormat for custom format parsing, advancedFormat for additional formatting tokens, isBetween and isSameOrBefore for comparison, and utc for UTC date handling. The immutability ensures that date objects are never modified in place. The chaining for fluent API usage. The locale support for internationalization. The TypeScript definitions. Designed by iamkun. Designed for JavaScript developers.

Tags & Categories

Categories

Statistics

1
Views
0
Clicks
0
Like
0
Dislike

Comments

Log In to post a comment

No comments yet. Be the first!