dayjs
2KB immutable date time library alternative to Moment.js with the same modern API
About
2KB immutable date time library alternative to Moment.js with the same modern API
What detecting dayjs tells you about a site
dayjs reveals a deliberately lightweight date strategy — a 2 KB, Moment-compatible API chosen to avoid Moment's large, mutable footprint. Its presence signals a team that needed friendly date formatting and parsing without paying Moment's bundle cost, and is comfortable wiring up its plugin system.
Why the exact dayjs version matters
Day.js functionality is split into opt-in plugins (utc, timezone, relativeTime); the exact version and which plugins ship tell you how much date capability the page actually carries.
dayjs in a real-world stack
When you find dayjs in a bundle, it rarely travels alone. Often pulled in transitively by UI libraries like Ant Design; otherwise paired directly with the app's date-display components.
Quick facts
npm install dayjsHow Sourcemap Explorer detects dayjs
dayjs ships as v1.11.21, published 2026-05-26 and carries 0 direct dependencies, 134 versions on the registry. Those exact numbers are the footprint Sourcemap Explorer matches when dayjs rides inside a deployed bundle — here is how the detection works.
We catch dayjs from two complementary signals: bundled source paths and the embedded package.json. Modern bundlers (webpack, Vite, esbuild, Rollup, Turbopack) preserve the original node_modules/dayjs/ paths inside the JavaScript sourcemap's sources[] array — that's the canonical signal. When the matching package.json is also captured in sourcesContent[], we read the exact version field — patch number included. No regex guessing, no version inference.
- 1
Confirm the site exposes sourcemaps
In DevTools Network, check the response headers of any application script for `SourceMap` or `X-SourceMap`. Failing that, fetch the script's last 4 KB and look for a `//# sourceMappingURL=` comment — that map is where the `dayjs` paths live.
- 2
Find the package in the bundle
Open DevTools → Network → reload. Click any application script and look at its sourcemap. Inside, search `sources[]` for entries matching `node_modules/dayjs/` — every match confirms the package is bundled. The matching `sourcesContent[i]` for `node_modules/dayjs/package.json` gives you the exact installed version.
- 3
Read the version directly from package.json
Run `jq -r '. as $m | $m.sources | to_entries[] | select(.value | endswith("node_modules/dayjs/package.json")) | $m.sourcesContent[.key] | fromjson | .version' bundle.js.map`. Sourcemap Explorer automates the same query in the popup.
Recent versions
dayjs README
Live mirror of the GitHub README, for reference. Updated whenever the repo's default branch changes.
English | 简体中文 | 日本語 | Português Brasileiro | 한국어 | Español (España) | Русский | Türkçe | සිංහල
Fast 2kB alternative to Moment.js with the same modern API
Day.js is a minimalist JavaScript library that parses, validates, manipulates, and displays dates and times for modern browsers with a largely Moment.js-compatible API. If you use Moment.js, you already know how to use Day.js.
dayjs().startOf('month').add(1, 'day').set('year', 2018).format('YYYY-MM-DD HH:mm:ss');
- 🕒 Familiar Moment.js API & patterns
- 💪 Immutable
- 🔥 Chainable
- 🌐 I18n support
- 📦 2kb mini library
- 👫 All browsers supported
Getting Started
Documentation
You can find for more details, API, and other docs on day.js.org website.
Installation
npm install dayjs --save
API
It's easy to use Day.js APIs to parse, validate, manipulate, and display dates and times.
dayjs('2018-08-08') // parse
dayjs().format('{YYYY} MM-DDTHH:mm:ss SSS [Z] A') // display
dayjs().set('month', 3).month() // get & set
dayjs().add(1, 'year') // manipulate
dayjs().isBefore(dayjs()) // query
I18n
Day.js has great support for internationalization.
But none of them will be included in your build unless you use it.
import 'dayjs/locale/es' // load on demand
dayjs.locale('es') // use Spanish locale globally
dayjs('2018-05-05').locale('zh-cn').format() // use Chinese Simplified locale in a specific instance
Plugin
A plugin is an independent module that can be added to Day.js to extend functionality or add new features.
import advancedFormat from 'dayjs/plugin/advancedFormat' // load on demand
dayjs.extend(advancedFormat) // use plugin
dayjs().format('Q Do k kk X x') // more available formats
Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
[Become a sponsor via Github] [Become a sponsor via OpenCollective]
Contributors
This project exists thanks to all the people who contribute.
Please give us a 💖 star 💖 to support us. Thank you.
And thank you to all our backers! 🙏
License
Day.js is licensed under a MIT License.
FAQ
What is dayjs used for?
2KB immutable date time library alternative to Moment.js with the same modern API
How can I tell if a website is using dayjs?
Open the page in Chrome with the Sourcemap Explorer extension installed and read the Stack tab. We catch `dayjs` from two complementary signals: `node_modules/dayjs/` paths inside the JavaScript sourcemap, and the embedded `package.json` we read for exact-version detection. Without the extension you can do the same lookup manually in DevTools — the steps are listed in the "How Sourcemap Explorer detects" section above.
How do I find out which version of dayjs a website is running?
Read it straight from the site's JavaScript sourcemap. When a build ships source maps, the bundled `dayjs/package.json` carries the exact `version` string — Sourcemap Explorer extracts it in one click on the Stack tab, and you can do it by hand in DevTools by opening the `.map` file and searching for `node_modules/dayjs/package.json`. That is far more reliable than inferring the version from an asset-hash or a `?ver=` query string, which is all surface-level detectors have to go on. The current npm release is 1.11.21, but real deployments frequently run an older pinned version — which is exactly why reading the bundled number matters.
What is the latest version of dayjs?
1.11.21, as published on the npm registry. The "Recent versions" table on this page lists the most recent 8 releases with their release dates. Sourcemap Explorer reports the version actually bundled into a site, which can lag the latest release by months on real-world deployments.
Is dayjs actively maintained?
Very actively maintained — the last release shipped within the past three months. The last published release was 2026-05-26. Source code: https://github.com/iamkun/dayjs.
Where can I read more?
Project homepage: https://day.js.org. Source code: https://github.com/iamkun/dayjs. Published on npm: https://www.npmjs.com/package/dayjs. Licensed as MIT.
Detected by Sourcemap Explorer
When a bundle ships sourcemaps, we read the embedded package.json for dayjs and report the precise version (the registry's latest is v1.11.21, published 2026-05-26; the bundled copy is often older). Without sourcemaps, an import / require in the page's scripts is enough to flag it.

