@18f/us-federal-holidays
Advanced tools
Comparing version
@@ -7,3 +7,3 @@ const dayjs = require("dayjs"); | ||
const getDateFor = ({ day = 1, month, year }) => | ||
dayjs(`${year}-${month}-${day}`, "YYYY-MM-DD"); | ||
dayjs(`${year}-${month}-${day}`, "YYYY-M-D"); | ||
@@ -31,3 +31,3 @@ const getNthDayOf = (n, day, month, year) => { | ||
const daysInMonth = dayjs(getDateFor({ month, year })).daysInMonth(); | ||
const lastDayOfMonth = dayjs(`${year}-${month}-${daysInMonth}`, "YYYY-MM-DD"); | ||
const lastDayOfMonth = dayjs(`${year}-${month}-${daysInMonth}`, "YYYY-M-D"); | ||
@@ -34,0 +34,0 @@ let result = lastDayOfMonth.day(day); |
@@ -0,3 +1,12 @@ | ||
const customParseFormat = require("dayjs/plugin/customParseFormat"); | ||
const dayjs = require("dayjs"); | ||
const tap = require("tap"); | ||
// The customParseFormat plugin changes the way the dayjs() utility method | ||
// handles format strings. Specifically, MM and DD format tokens will REQUIRE | ||
// two-digit months and days, whereas the default constructor will happily take | ||
// single-digit months and days. Add the plugin to our tests to make sure we | ||
// still work in environments where the plugin is being used. | ||
dayjs.extend(customParseFormat); | ||
const federalHolidays = require("./index"); | ||
@@ -4,0 +13,0 @@ |
{ | ||
"name": "@18f/us-federal-holidays", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "All about US federal holidays", | ||
@@ -20,3 +20,4 @@ "main": "index.js", | ||
"Tse Kit Yam (https://github.com/tsekityam)", | ||
"Ben Berry (https://github.com/bengerman13)" | ||
"Ben Berry (https://github.com/bengerman13)", | ||
"Keith Pops (https://github.com/keithpops)" | ||
], | ||
@@ -23,0 +24,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
28979
1.99%483
1.68%