Socket
Socket
Sign inDemoInstall

date-fns-duration

Package Overview
Dependencies
1
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    date-fns-duration

Supplemental package for date-fns to add/subtract ISO 8601 durations


Version published
Weekly downloads
1.1K
increased by3.24%
Maintainers
1
Install size
2.17 kB
Created
Weekly downloads
 

Readme

Source

data-fns-duration

Complementary package for date-fns to add/subtract ISO 8601 durations to/from dates.

Installation

Install it alongside date-fns

npm i -S date-fns-duration

API


import addDuration from 'date-fns-duration';

// addDuration(date, duration);

// Add duration
const two_hours_from_now = addDuration(Date.now(), "PT2H");

// Subtract duration
const month_before = addDuration("2018-10-02T10:00", "-P1M");

Keywords

FAQs

Last updated on 24 Nov 2020

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