Closed JoeChapman closed 9 years ago
Yup, intentionally. It's a plugin, so it modifies the original library.
You only need to require it in a single time in your entire node app. From then on, you can just require moment
and access the API.
In other words, you might have...
// plugins.js
// Load up moment business!
require('moment-business');
// some-file.js
var moment = require('moment');
moment.weekDays(...);
Does that make sense, @JoeChapman ?
Cheers @jmeas
:beers:
@jmeas I' m a newbie in this area. I' m getting very confused on how to use this library in browser html and js. What should I use to call the function subtractWeekDays after including the js files in <script>
tag as follows:
<script type="text/javascript" src="js/node_modules/contained-periodic-values/dist/contained-periodic-values.min.js"></script>
<script type="text/javascript" src="js/node_modules/nearest-periodic-value/dist/nearest-periodic-value.min.js"></script>
<script type="text/javascript" src="js/node_modules/skipped-periodic-values/dist/skipped-periodic-values.min.js"></script>
<script type="text/javascript" src="js/node_modules/moment-business/dist/moment-business.min.js"></script>
I would get business is not defined
error if using business.subtractWeekDays
. Thanks!
@xgdgsc , there is a bug that is attaching it to none
on the window. This is my mistake – I'm sorry about that! I'll open a new issue and track fixing it there.
Update: Opened as #45
moment-business.js does not export moment