Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 18, 2024 via pnpm

dayjs 1.11.10

2KB immutable date time library alternative to Moment.js with the same modern API
Package summary
Share
0
issues
1
license
1
MIT
Package created
10 Apr 2018
Version published
19 Sep 2023
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
dayjs@1.11.10
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of dayjs 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does dayjs do?

Day.js serves as a powerful yet minimalist JavaScript library that is optimized for parsing, validating, manipulating, and showcasing dates and times for modern browsers. What sets Day.js apart is its Moment.js-compatible API and compact 2KB size, which makes it a nifty yet lightweight alternative to Moment.js. It supports all types of browsers, and its familiar Moment.js API and patterns, immutability in nature, chainability, and internationalization support make it a handy tool for developers.

How do you use dayjs?

To use Day.js, you first need to install it in your JavaScript project with the npm command npm install dayjs --save. Once installed, you can utilize its API to perform a variety of actions on dates and times. Here are a few examples:

Parsing a date:

dayjs('2018-08-08')

Displaying date:

dayjs().format('{YYYY} MM-DDTHH:mm:ss SSS [Z] A')

Getting and setting dates:

dayjs().set('month', 3).month()

Manipulating dates:

dayjs().add(1, 'year')

Querying dates:

dayjs().isBefore(dayjs())

Day.js also supports internationalization:

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 specific instance

And you can extend its functionality using plugins:

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

Where are the dayjs docs?

The complete documentation, API references, and other related Day.js docs can be found on the day.js.org website. This website hosts an array of information about Day.js, ranging from API usage and command instructions to plugin information and internationalization instructions.