Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requiring unknown module "./locale/fa" #142

Open
mehranabi opened this issue Jun 13, 2018 · 4 comments
Open

Requiring unknown module "./locale/fa" #142

mehranabi opened this issue Jun 13, 2018 · 4 comments

Comments

@mehranabi
Copy link

mehranabi commented Jun 13, 2018

Hello, Thanks for this nice library,

I'm using moment-jalaali in my React Native project, I get this error when launch release version of application:

com.facebook.react.common.JavascriptException: Requiring unknown module "./locale/fa"., stack:
    d@2:595
    n@2:339
    t@2:262
    vt@642:16755
    Mt@642:17781
    pt@642:16844
    loadPersian@641:8971
    value@306:848
    commitLifeCycles@41:56506
    C@41:70217
    T@41:68596
    y@41:68020
    v@41:67857
    h@41:67136
    c@41:66390
    t@41:73330
    updateContainer@41:73948
    render@41:78797
    exports@283:420
    run@279:615
    runApplication@279:2046
    value@18:3582
    <unknown>@18:1067
    value@18:3009
    value@18:1039

I think this error related to

Can you fix it, or give any solution for me ??

@thg303
Copy link

thg303 commented Mar 26, 2019

any update on this issue?

@HessiPard
Copy link

+1

@abbasmoosavi
Copy link

Hello, Thanks for this nice library,

I'm using moment-jalaali in my React Native project, I get this error when launch release version of application:

com.facebook.react.common.JavascriptException: Requiring unknown module "./locale/fa"., stack:
    d@2:595
    n@2:339
    t@2:262
    vt@642:16755
    Mt@642:17781
    pt@642:16844
    loadPersian@641:8971
    value@306:848
    commitLifeCycles@41:56506
    C@41:70217
    T@41:68596
    y@41:68020
    v@41:67857
    h@41:67136
    c@41:66390
    t@41:73330
    updateContainer@41:73948
    render@41:78797
    exports@283:420
    run@279:615
    runApplication@279:2046
    value@18:3582
    <unknown>@18:1067
    value@18:3009
    value@18:1039

I think this error related to

Can you fix it, or give any solution for me ??

I fixed this problem, see my code in bottom:

import m from 'moment-jalaali';
import fa from 'moment/src/locale/fa';


function convertDate(language, date) {
  const calender = m
    .utc(date, 'YYYY-MM-DDTHH:mm:ss')
    .utcOffset(getTimezone())
    .format('YYYY-MM-DDTHH:mm:ss');
  if (language.value === 'fa') {
    m.locale('fa', fa);
    m.loadPersian({ dialect: 'persian-modern' });
  }
  return m.utc(calender, 'YYYY-MM-DDTHH:mm:ss').calendar();
}

@VarshaBawari
Copy link

VarshaBawari commented Apr 22, 2020

Was able to fix with this one moment/moment#3624 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants