ods-holidays
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -10,3 +10,6 @@ var holidays = require('./holiday.model'); | ||
return Promise.all(holidaysInMonth).then((results) => { | ||
if (results[0].serviceHoliday && results[0].serviceHoliday === date.format('MM-DD-YYYY') || results[0].date === date) { | ||
var serviceHoliday = results[0].serviceHoliday; | ||
var actualDate = results[0].date; | ||
var givenDate = date.format('MM-DD-YYYY'); | ||
if ((serviceHoliday && serviceHoliday === givenDate) || actualDate === givenDate) { | ||
return {isHoliday: true}; | ||
@@ -13,0 +16,0 @@ } |
{ | ||
"name": "ods-holidays", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "API for calculating correct past and future dates of government recognized holidays in Ontario", | ||
@@ -5,0 +5,0 @@ "author": "Cheyenne Arrowsmith <cheyenne.arrowsmith@ontario.ca>", |
@@ -114,4 +114,4 @@ ## Ontario Digital Serice Public Holidays Calulator | ||
This function is currently used to return whether a given date (in the format MM-DD-YYYY) is a government holiday. This informs services that government offices et al would be closed on these dates. | ||
It will run the function for a given month and if the given date matches the returned date OR the serviceHoliday date (if it exists) then it will return `{isHoliday: true}`, otherwise it returns `{isHoliday: false}`. | ||
For example: If January 1st of a given year falls on a Saturday then January 3rd would be the government holiday and therefore return `{isHoliday: true}` if 01-03-`year` fulfilled these requirements. | ||
@@ -118,0 +118,0 @@ #### Running tests |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37996
806