GithubHelp home page GithubHelp logo

jonstuebe / date-fns-holiday-us Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 9.0 352 KB

An interface to work with holidays using date-fns

License: MIT License

TypeScript 90.64% JavaScript 9.36%
date-fns date holiday holidays

date-fns-holiday-us's People

Contributors

dependabot[bot] avatar jonstuebe avatar julesbecker avatar shmulik-rosi avatar yiin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

date-fns-holiday-us's Issues

ES6 module exports failing from 0.3.1 => 1.0.1

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?

Feature Request - Substitute Holidays

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.