Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

date-holidays-parser

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

date-holidays-parser - npm Package Compare versions

Comparing version 1.6.0 to 2.0.0

types/index.d.ts

7

es/Holidays.js

@@ -248,3 +248,3 @@ /**

* @param {Date} [date]
* @return {Object} holiday:
* @return {Array<Holiday>|false} holiday:
* ```

@@ -264,2 +264,3 @@ * {String} date - ISO Date String of (start)-date in local format

var rules = Object.keys(this.holidays);
var days = [];

@@ -271,3 +272,3 @@ for (var i in rules) {

if (hd[j] && date >= hd[j].start && date < hd[j].end) {
return this._translate(hd[j]);
days.push(this._translate(hd[j]));
}

@@ -277,3 +278,3 @@ }

return false;
return days.length ? days : false;
},

@@ -280,0 +281,0 @@

@@ -267,3 +267,3 @@ /**

* @param {Date} [date]
* @return {Object} holiday:
* @return {Array<Holiday>|false} holiday:
* ```

@@ -283,2 +283,3 @@ * {String} date - ISO Date String of (start)-date in local format

var rules = Object.keys(this.holidays);
var days = [];

@@ -290,3 +291,3 @@ for (var i in rules) {

if (hd[j] && date >= hd[j].start && date < hd[j].end) {
return this._translate(hd[j]);
days.push(this._translate(hd[j]));
}

@@ -296,3 +297,3 @@ }

return false;
return days.length ? days : false;
},

@@ -299,0 +300,0 @@

{
"name": "date-holidays-parser",
"version": "1.6.0",
"version": "2.0.0",
"description": "parser for worldwide holidays",

@@ -25,2 +25,3 @@ "keywords": [

"main": "lib",
"typings": "types",
"directories": {

@@ -32,3 +33,3 @@ "lib": "lib",

"scripts": {
"all": "npm-run-all clean lint build build:es5 test",
"all": "npm-run-all clean lint build build:es5 ci",
"build": "babel -d lib src",

@@ -45,2 +46,4 @@ "build:es5": "BABEL_ENV=es5 babel -d es src",

"test": "mocha",
"ci": "npm-run-all test:*",
"test:ts": "dtslint types",
"test:tz": "TZ=UTC-10 npm test && TZ=UTC+10 npm test",

@@ -100,2 +103,3 @@ "zuul": "zuul test/Holidays.test.js"

"core-js": "^2.6.12",
"dtslint": "^3.6.12",
"eslint": "^7.16.0",

@@ -112,3 +116,4 @@ "eslint-config-standard": "^16.0.2",

"rimraf": "^3.0.2",
"serialize-to-js": "^3.1.1"
"serialize-to-js": "^3.1.1",
"typescript": "^3.9.7"
},

@@ -115,0 +120,0 @@ "engines": {

@@ -200,3 +200,3 @@ /**

* @param {Date} [date]
* @return {Object} holiday:
* @return {Array<Holiday>|false} holiday:
* ```

@@ -216,2 +216,3 @@ * {String} date - ISO Date String of (start)-date in local format

const rules = Object.keys(this.holidays)
const days = []
for (const i in rules) {

@@ -221,7 +222,7 @@ const hd = [].concat(this._dateByRule(year, rules[i]))

if (hd[j] && date >= hd[j].start && date < hd[j].end) {
return this._translate(hd[j])
days.push(this._translate(hd[j]))
}
}
}
return false
return days.length ? days : false
},

@@ -228,0 +229,0 @@

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