Comments (2)
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.
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)
- minification (?) causes error in gulp build process HOT 3
- NodeJs: Regions is not defined (in strict_mode) HOT 5
- Lacking Webpack integration HOT 12
- Calculates Day After Thanksgiving incorrectly for 2019 HOT 6
- modifyHolidays.set() only works on server side HOT 2
- some issue using this in angular HOT 5
- Incorrect Date for Canadian Thanksgiving
- Add support for French public holidays HOT 1
- add International Women's Day
- TypeError: Cannot read property 'fn' of undefined
- isHoliday() doesn't work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moment-holiday.