Giter Club home page Giter Club logo

Comments (2)

daniel-varela avatar daniel-varela commented on May 27, 2024

As stated in the documentation:

If you're not using Node (or anything that doesn't support the require function), you'll need to make sure that you include the locale file(s) that you're trying to use.

<script src="./moment-holiday/locale/canada.js"></script>
<script src="./moment-holiday/locale/easter.js"></script>
<script>
  moment.modifyHolidays.set('Canada').add('Easter');
  moment('2001-12-26').isHoliday('Boxing Day');
  //true
</script>

from moment-holiday.

rlayne avatar rlayne commented on May 27, 2024

Oh, I'm sorry. I thought the minimal example provided under "browsers" would be sufficient. I should have read the entire document just in case something like that was randomly put in later.

Adding the additional locale file(s) doesn't change the outcome whatsoever.

<script src="js/moment.js"></script>
<script src="js/moment-holiday.js"></script>
<script src="js/united_kingdom.js"></script>
<script>
var currentTime = moment();
console.log(currentTime); //Correct time shown

console.log('YOU: ' + currentTime.format("HH:mm DD-MM-YYYY")); //Correct time shown

var holiday = moment().isHoliday(null, true); //moment(...).isHoliday is not a function
</script>```

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.