Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dayjs

Package Overview
Dependencies
Maintainers
1
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dayjs

2KB immutable date time library alternative to Moment.js with the same modern API

  • 1.11.13
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
21M
decreased by-9.32%
Maintainers
1
Weekly downloads
 
Created

What is dayjs?

The dayjs npm package is a minimalist JavaScript library that parses, validates, manipulates, and displays dates and times for modern browsers with a largely Moment.js-compatible API. It is lightweight and offers various functionalities to handle dates and times effectively.

What are dayjs's main functionalities?

Parsing

Parse a date string into a dayjs object.

dayjs('2023-04-01')

Validation

Check if a date is valid.

dayjs('2023-04-01').isValid()

Manipulation

Manipulate the date by adding time to it.

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

Display

Display the date in a specified format.

dayjs().format('YYYY-MM-DD')

Query

Query the date to compare with another date.

dayjs().isBefore(dayjs('2023-12-31'))

Localization

Localize the date to a different language.

dayjs().locale('es').format('dddd, MMMM D YYYY')

Timezone

Handle timezone conversions.

dayjs().tz('America/New_York').format()

Other packages similar to dayjs

Keywords

FAQs

Package last updated on 20 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc