New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

date-fns-duration

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

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

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.6K
decreased by-0.66%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 24 Nov 2020

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