moment-hijri
moment-hijri copied to clipboard
moment.localeData is not a function
I am working on a sveltekit project. When I am trying to import moment-hijri, it says to me "moment.localeData is not a function". But It's working fine in my sapper project. How can I solve this?
Hi @programmeranamul
I'm facing same issue, have you managed to solve it?
@programmeranamul @mahmodHammad I'm facing the same issue, any clue on how to solve this issue ?
I am also facing the same issue in my Vue JS Project. Does anybody has solved it?
Yes. I had solved the issue. I had changed some code in moment-hijri core file.
On Mon, Oct 23, 2023, 4:02 PM Milad Rastin @.***> wrote:
I am also facing the same issue. Does anybody has solved it?
— Reply to this email directly, view it on GitHub https://github.com/xsoh/moment-hijri/issues/82#issuecomment-1774844762, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASKRIKDUM5QFTUHSIW25DTTYAY6CZAVCNFSM5775AWKKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZXGQ4DINBXGYZA . You are receiving this because you were mentioned.Message ID: @.***>
Can you please give me an example of the changes?
based on @programmeranamul opinion, I've changed the moment-hijri.js core file available in node_modules/moment-hijri. I only changed moment to moment/moment. Here is what I've done : line 12 to 22 ` /* global define */
if (typeof define === 'function' && define.amd) {
define(['moment/moment'], function (moment) {
root.moment = factory(moment)
return root.moment
})
} else if (typeof exports === 'object') {
module.exports = factory(require('moment/moment'))
} else {
root.moment = factory(root.moment)
}
`
based on @programmeranamul opinion, I've changed the moment-hijri.js core file available in node_modules/moment-hijri. I only changed moment to moment/moment. Here is what I've done : line 12 to 22 ` /* global define */
if (typeof define === 'function' && define.amd) { define(['moment/moment'], function (moment) { root.moment = factory(moment) return root.moment }) } else if (typeof exports === 'object') { module.exports = factory(require('moment/moment')) } else { root.moment = factory(root.moment) }
`
can this be turned into a PR so that the issue can be permanently solved? it has been 2 years since the last update of this repo