jonstuebe / date-fns-holiday-us Goto Github PK
View Code? Open in Web Editor NEWAn interface to work with holidays using date-fns
License: MIT License
An interface to work with holidays using date-fns
License: MIT License
dateFnsHolidayUs.getObservedHolidays('2022') is not returning December 26 as observed holiday. It only returns Juneteenth.
For your reference
https://runkit.com/embed/b6zs5hq17wtr
Code that used to work in version 0.3.1, e.g.:
import { getChristmas } from 'date-fns-holiday-us';
are no longer working in version 1.0.1 and onwards, with the following error:
import { getChristmas } from 'date-fns-holiday-us';
^^^^^^^^^^^^
SyntaxError: Named export 'getChristmas' not found. The requested module 'date-fns-holiday-us' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:
import pkg from 'date-fns-holiday-us';
const { getChristmas } = pkg;
at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:189:5)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:527:24)
at async loadESM (node:internal/process/esm_loader:91:5)
at async handleMainPromise (node:internal/modules/run_main:65:12)
Node.js v18.9.0
Is this the intended behaviour?
Would be nice to have the option, particularly when using getBankHolidays, to return substitute holidays. Substitutes for holidays falling on Saturday are on the preceding Friday and for holidays falling on Sundays are on the following Monday. (source)
i.e. In 2021, Independence Day's substitute would be Monday July 5 and Christmas Day's Substitute would be Friday, December 24.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.