Socket
Socket
Sign inDemoInstall

dayjs

Package Overview
Dependencies
0
Maintainers
1
Versions
124
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    dayjs


Version published
Maintainers
1
Install size
1.44 kB
Created

Package description

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

Readme

Source

dayjs

FAQs

Last updated on 11 Apr 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc