Gathering detailed insights and metrics for dayjs
Gathering detailed insights and metrics for dayjs
Gathering detailed insights and metrics for dayjs
Gathering detailed insights and metrics for dayjs
⏰ Day.js 2kB immutable date-time library alternative to Moment.js with the same modern API
npm install dayjs
Typescript
Module System
Node Version
NPM Version
99.5
Supply Chain
84.3
Quality
78.5
Maintenance
100
Vulnerability
100
License
Updated on 06 Dec 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
19.1%
Compared to previous day
Last week
-0.1%
Compared to previous week
Last month
1.8%
Compared to previous month
Last year
21.8%
Compared to previous year
29
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.
1dayjs().startOf('month').add(1, 'day').set('year', 2018).format('YYYY-MM-DD HH:mm:ss');
You can find more details, API, and other docs on day.js.org website.
1npm install dayjs --save
It's easy to use Day.js APIs to parse, validate, manipulate, and display dates and times.
1dayjs('2018-08-08') // parse 2 3dayjs().format('{YYYY} MM-DDTHH:mm:ss SSS [Z] A') // display 4 5dayjs().set('month', 3).month() // get & set 6 7dayjs().add(1, 'year') // manipulate 8 9dayjs().isBefore(dayjs()) // query
Day.js has great support for internationalization.
But none of them will be included in your build unless you use it.
1import 'dayjs/locale/es' // load on demand 2 3dayjs.locale('es') // use Spanish locale globally 4 5dayjs('2018-05-05').locale('zh-cn').format() // use Chinese Simplified locale in a specific instance
A plugin is an independent module that can be added to Day.js to extend functionality or add new features.
1import advancedFormat from 'dayjs/plugin/advancedFormat' // load on demand 2 3dayjs.extend(advancedFormat) // use plugin 4 5dayjs().format('Q Do k kk X x') // more available formats
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]
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! 🙏
Day.js is licensed under a MIT License.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
8 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 6
Reason
Found 4/21 approved changesets -- score normalized to 1
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
92 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-02
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More