Day.js by iamkun
A tiny library for parsing, checking, changing and formatting dates and times, about 2 KB in size. A developer known as iamkun published it in April 2018, and it has since collected tens of thousands of stars on GitHub.
Real, or AI slop?
The story
Day.js is a tiny JavaScript library for parsing, formatting and doing maths with dates. Created by iamkun in 2018, it copies the API of Moment.js, the most popular date library of its time, so developers could switch with few changes.
The difference is size. Moment.js was large and modified dates in place, which caused subtle bugs. Day.js weighs about 2 KB, never changes a date in place (every operation returns a new object), and adds extra features through plugins.
Good to know
- In 2020 the Moment.js team declared it a legacy project and suggested alternatives, Day.js among them.
- Immutability means
date.add(1, "day")gives you a new date and leaves the original alone. - JavaScript is getting a modern built-in date API, Temporal, meant to fix the old
Dateobject’s problems.
Background written with Claude (Opus 5.5) from public sources.