Open rlayne opened 6 years ago
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>
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>```
I can't get any indication this plugin works with the latest or previous versions of moment.js. (I tried specifically using moment.js 2.0.0 as well as latest as of today).
Minimal case is: