fingerpich / jalali-moment

Display, parse, manipulate, validate and convert jalali (Persian, Khorshidi, Shamsi) or Gregorian (Miladi) dates and times.
https://fingerpich.github.io/jalali-moment/
MIT License
435 stars 68 forks source link

Problem with moment 2.25.0 and node 14.1.0 #89

Closed hamidne closed 4 years ago

hamidne commented 4 years ago

I have recently update node version and upgrade packages and get this error when run project:

Node: v14.1.0 OS: macOS 10.15.3 Browser: Google Chrome 81.0.4044.129

Uncaught TypeError: moment.localeData is not a function
    at eval (jalali-moment.js?042b:225)
    at Object../node_modules/jalali-moment/jalali-moment.js (vendors.app.js:3616)
    at __webpack_require__ (runtime.js:854)
    at fn (runtime.js:151)
    at eval (Model.js:18)
    at Module../models/Model.js (app.js:978)
    at __webpack_require__ (runtime.js:854)
    at fn (runtime.js:151)
    at eval (AttributeGroup.js:16)
    at Module../models/AttributeGroup.js (app.js:930)
MRezaHa commented 4 years ago

I have same issue recently node version: 10.15.3

Uncaught TypeError: moment.localeData is not a function at Object.../../node_modules/jalali-moment/jalali-moment.js (jalali-moment.js:224) at webpack_require (bootstrap:78) at Module../src/app/shared/material.persian-date.adapter.ts (applicant-excel-dialog.component.ts:10) at webpack_require (bootstrap:78) at Module../src/app/app.module.ts (app.component.ts:21) at webpack_require (bootstrap:78) at Module../src/main.ts (main.ts:1) at webpack_require (bootstrap:78) at Object.0 (main.ts:17) at __webpack_require__ (bootstrap:78)

fingerpich commented 4 years ago

localeData is a method of moment instance you have to use it as the following code

moment().localeData()