holidays-cs
Advanced tools
Comparing version 0.0.3 to 0.0.4
@@ -8,27 +8,2 @@ export * from "./easter.js"; | ||
export * from "./shops.js"; | ||
import { DateTime } from "luxon"; | ||
interface Easter { | ||
name: string | undefined; | ||
isGoodFriday: boolean; | ||
isHolySaturday: boolean; | ||
ieEasterSunday: boolean; | ||
isEasterMonday: boolean; | ||
} | ||
interface ShopsStatus { | ||
areOpen: boolean; | ||
status: string; | ||
} | ||
interface DayMetadata { | ||
names: string[]; | ||
isSignificantDay: boolean; | ||
significantDay: string | undefined; | ||
isPublicHoliday: boolean; | ||
publicHoliday: string | undefined; | ||
easter: Easter | undefined; | ||
shops: ShopsStatus; | ||
} | ||
/** | ||
* Get metadata for a specific day | ||
* @param date | ||
*/ | ||
export declare function getDayMeta(date: DateTime | Date): DayMetadata; | ||
export * from "./get-meta.js"; |
@@ -17,3 +17,2 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.getDayMeta = void 0; | ||
__exportStar(require("./easter.js"), exports); | ||
@@ -26,42 +25,2 @@ __exportStar(require("./holidays.js"), exports); | ||
__exportStar(require("./shops.js"), exports); | ||
const luxon_1 = require("luxon"); | ||
const names_js_1 = require("./names.js"); | ||
const holidays_js_1 = require("./holidays.js"); | ||
const significant_js_1 = require("./significant.js"); | ||
const shops_js_1 = require("./shops.js"); | ||
const easter_js_1 = require("./easter.js"); | ||
/** | ||
* Get metadata for a specific day | ||
* @param date | ||
*/ | ||
function getDayMeta(date) { | ||
date = date instanceof Date ? luxon_1.DateTime.fromJSDate(date) : date; | ||
let easter = undefined; | ||
if ((0, easter_js_1.isHolyWeek)(date)) { | ||
easter = { | ||
name: (0, easter_js_1.getEasterDayName)(date), | ||
isGoodFriday: (0, easter_js_1.isGoodFriday)(date), | ||
isHolySaturday: (0, easter_js_1.isHolySaturday)(date), | ||
ieEasterSunday: (0, easter_js_1.isEasterSunday)(date), | ||
isEasterMonday: (0, easter_js_1.isEasterMonday)(date), | ||
}; | ||
} | ||
let shops = { | ||
areOpen: (0, shops_js_1.areShopsOpen)(date), | ||
status: (0, shops_js_1.getShopsStatus)(date) | ||
}; | ||
return { | ||
names: (0, names_js_1.getNameDayArray)(date), | ||
// easter metadata | ||
easter: easter, | ||
// national significant days | ||
isSignificantDay: (0, significant_js_1.isSignificantDay)(date), | ||
significantDay: (0, significant_js_1.getSignificantDay)(date), | ||
// national holidays | ||
isPublicHoliday: (0, holidays_js_1.isPublicHoliday)(date), | ||
publicHoliday: (0, holidays_js_1.getPublicHoliday)(date), | ||
// shops metadata | ||
shops: shops | ||
}; | ||
} | ||
exports.getDayMeta = getDayMeta; | ||
__exportStar(require("./get-meta.js"), exports); |
@@ -43,3 +43,3 @@ { | ||
}, | ||
"version": "0.0.3" | ||
"version": "0.0.4" | ||
} |
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
36271
23
966