Open lutherism opened 7 years ago
were you able to get moment/moment-hijri working in your project? I get an error: Uncaught TypeError: moment.localeData is not a function
from this line extend(getPrototypeOf(moment.localeData()), {
of line 274 in moment-hijri.js when I try to use it below. When I go and examine moment at this line, i see
I am using parceljs to bundle my application though.
import moment from "moment";
import momenti from "moment-hijri";
console.log("moment:", moment());
console.log("momenti:", momenti);
Hello. I'm concerned using this library has implicit conflicts with other plugins. By adding methods to the singleton moment object at import time, it's possible to have conflicts at a distance in an app.
I'd advocate for exporting a "High Order Function" instead, so that the consumer can decide when/where to apply the plugin, and that will leave the original module unmodified.
ie:
becomes
or in es6
Also remove need for AMD export in repo, as AMD projects could do: