Coder Social home page Coder Social logo

Comments (5)

jamesplease avatar jamesplease commented on July 19, 2024 1

@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

from moment-business.

jamesplease avatar jamesplease commented on July 19, 2024

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 ?

from moment-business.

JoeChapman avatar JoeChapman commented on July 19, 2024

Cheers @jmeas

from moment-business.

jamesplease avatar jamesplease commented on July 19, 2024

🍻

from moment-business.

xgdgsc avatar xgdgsc commented on July 19, 2024

@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!

from moment-business.

Related Issues (20)

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.