Socket
Socket
Sign inDemoInstall

fast-dates

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fast-dates

Fastest lib for date working days diff between two dates. Custom exclusions available.


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Fast-dates

This project looks forward to do Date operations fast, really fast.

Install

npm install fast-dates

Or

yarn add fast-dates

Usage

const fastDates = require('fast-dates');

console.log(workingDaysDiff('2017-10-11T12:12:12.000Z', '2017-10-27T12:12:12.000Z', true)) // 12 days
console.log(workingDaysDiff('2017-10-11T12:12:12.000Z', '2017-10-27T00:12:12.000Z', true)) // 11.5 days

Features

  • Working Days Diff
/**
 * Get difference in days between two dates excluding weekends.
 * Also you can give an array of dates to be excluded from the result.
 *
 * @param {any} from starting Date
 * @param {any} to target Date
 * @param {boolean} [precise=false] if true, will return a float number
 * @param {any} [exclude=[]] days to be excluded
 * @returns Number
 */
function workingDaysDiff (from, to, precise = false, exclude = []) { ...}

FAQs

Last updated on 11 Nov 2017

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