next-biz-date
Advanced tools
Comparing version 0.0.9 to 1.0.0
@@ -1,19 +0,19 @@ | ||
const moment = require("moment"); | ||
const nbd = require("../next-biz-date"); | ||
const holidays = [ | ||
"2020-12-17", | ||
"2020-12-25", | ||
"2020-12-28", | ||
"2021-01-01", | ||
"2021-01-04" | ||
"2020-12-17", | ||
"2020-12-25", | ||
"2020-12-28", | ||
"2021-01-01", | ||
"2021-01-04" | ||
]; | ||
const initialDate = "2020-12-24"; | ||
const offset = 1; | ||
const direction = "FORWARD"; | ||
const testCases = [ | ||
{initialDate: "2020-12-24", offset: 1, direction: "FORWARD", expected_result: "2020-12-29"}, | ||
{initialDate: "2020-12-29", offset: 1, direction: "BACKWARDS", expected_result: "2020-12-24"} | ||
]; | ||
const result = nbd.FindNextBizDate(initialDate, holidays, offset, direction); | ||
console.log("RESULT: ", result); | ||
console.log("INPUTS:",{initialDate, offset, direction}); | ||
testCases.forEach((item, idx)=>{ | ||
console.log(`CASE #${idx}: `,item); | ||
console.log(" RESULT: ", nbd.FindNextBizDate(item.initialDate, holidays, item.offset, item.direction)); | ||
}); |
{ | ||
"name": "next-biz-date", | ||
"version": "0.0.9", | ||
"version": "1.0.0", | ||
"description": "returns the next future business date based on a reference date and a number of days to look into the future and given array of holidays", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
@@ -35,21 +35,21 @@ # next-biz-date | ||
``` | ||
const moment = require("moment"); | ||
const nbd = require("next-biz-date"); | ||
const holidays = [ | ||
"2020-12-17", | ||
"2020-12-25", | ||
"2020-12-28", | ||
"2021-01-01", | ||
"2021-01-04" | ||
"2020-12-17", | ||
"2020-12-25", | ||
"2020-12-28", | ||
"2021-01-01", | ||
"2021-01-04" | ||
]; | ||
const initialDate = "2020-12-24"; | ||
const offset = 1; | ||
const direction = "FORWARD"; | ||
const testCases = [ | ||
{initialDate: "2020-12-24", offset: 1, direction: "FORWARD", expected_result: "2020-12-29"}, | ||
{initialDate: "2020-12-29", offset: 1, direction: "BACKWARDS", expected_result: "2020-12-24"} | ||
]; | ||
const result = nbd.FindNextBizDate(initialDate, holidays, offset, direction); | ||
console.log("RESULT: ", result); | ||
console.log("INPUTS:",{initialDate, offset, direction}); | ||
testCases.forEach((item, idx)=>{ | ||
console.log(`CASE #${idx}: `,item); | ||
console.log(" RESULT: ", nbd.FindNextBizDate(item.initialDate, holidays, item.offset, item.direction)); | ||
}); | ||
``` |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
11934
204
1
1