Giter Club home page Giter Club logo

Comments (5)

codeunifier avatar codeunifier commented on May 28, 2024 2

Still an issue - any update on this would be much appreciated.

from moment-holiday.

Silthus avatar Silthus commented on May 28, 2024

Did you find a solution for this? I am having the same problem.

from moment-holiday.

lwensveen avatar lwensveen commented on May 28, 2024

See this PR:

#31

You can use my fork like this:

    "moment-holiday": "https://github.com/lwensveen/moment-holiday.git#require",

from moment-holiday.

MartinLoeper avatar MartinLoeper commented on May 28, 2024

Hi there, we at @nesto-software are currently open sourcing a new moment-holiday library which further improves this great approach by kodie. There is only a small number of supported countries yet. However if you want to check it out: https://github.com/nesto-software/moment-holiday/

For the frontend, there is an usage example.

from moment-holiday.

madthad91 avatar madthad91 commented on May 28, 2024

Not super pretty, but this works in an angular cli project as such:

  1. add the following to the scripts array of your angular-cli.json file:

     "./node_modules/moment/min/moment.min.js",
     "./node_modules/moment-holiday/build/moment-holiday-us.min.js"
    
  2. In the file where you want to import moment-holiday, instead just add declare var moment: any; at the top of that file. Don't import moment or moment-holiday. Then use this library as normal: moment().holidaysBetween(<some_moment_object>)

EDIT: The reason why this is not too too bad, is that npmjs.com has runkit integration and you can test your code there: https://npm.runkit.com/moment-holiday

get it running, and just transfer the code to your main project

from moment-holiday.

Related Issues (12)

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.