Comments (5)
Still an issue - any update on this would be much appreciated.
from moment-holiday.
Did you find a solution for this? I am having the same problem.
from moment-holiday.
See this PR:
You can use my fork like this:
"moment-holiday": "https://github.com/lwensveen/moment-holiday.git#require",
from moment-holiday.
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.
Not super pretty, but this works in an angular cli project as such:
-
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"
-
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)
- 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
- broken? HOT 2
- 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.