Socket
Socket
Sign inDemoInstall

@cdellacqua/date-only

Package Overview
Dependencies
0
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @cdellacqua/date-only

A DateOnly class for JavaScript


Version published
Weekly downloads
10
increased by25%
Maintainers
1
Install size
21.3 kB
Created
Weekly downloads
 

Readme

Source

date-only

A DateOnly class for JavaScript

NPM Package

npm install @cdellacqua/date-only

Full documentation:

  • DateOnly

Highlights

Always serializes to YYYY-MM-DD

console.log(new DateOnly(2020, 0, 1).toString());
// -> 2020-01-01
console.log(new DateOnly(2020, 0, 1).toJSON());
// -> "2020-01-01"

Compatible with native Date object

console.log(DateOnly.fromDate(new Date(2020, 0, 1)).toString());
// -> 2020-01-01
console.log(new DateOnly(2020, 0, 1).toDate().toDateString());
// -> Wed Jan 01 2020

Keywords

FAQs

Last updated on 07 Aug 2021

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