dangrossman/bootstrap-daterangepicker — pull request #407 by skratchdot (2014-08-05 14:36:22+00:00)
Title: fixing typo so code works as a commonjs module

I understand if you don't want to pull this in (after my last disaster)- but I actually tested this time. The factory function declaration is declaring a 'momentjs' variable that is never actually used inside the function. By changing to 'moment' I'm able to use this within node.

The mistake with my last pull request is that I didn't test in the browser, and missed line 31 https://github.com/dangrossman/bootstrap-daterangepicker/blob/master/daterangepicker.js#L31 which calls the factory function. It passes in an undefined 'momentjs'. By changing this variable to 'moment', we pass in the global instance to the factory function.

The downside is that 'moment.js' *must* be loaded before daterangepicker.js is loaded. I'm not sure if you want to make this concession or not (although I think that is the case with the current codebase).

Also, feel free to just close this out. I don't want to break live sites (or the codebase in general)- I just thought it looked like a bug that should be fixed (but I might be missing something).

I pushed this change to a gh-pages branch as well so you can check it out live: http://skratchdot.github.io/bootstrap-daterangepicker/examples.html

Thanks for you work on this lib.