Skip to content

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

Notifications You must be signed in to change notification settings

mtxr/fast-dates.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 = []) { ...}

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published