Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

149
Visualizações
How to change moment locale in Reactjs when App renders

I asked the same question before but there was some confusion. Actually my question is - I have Reactjs application .The application has a Arabic version and English version. And in the application i am using moment.jsto format the timestamp.when the App renders ,I am storing a language variable in localstorage ,i want what the value of that will be it should apply on moment.locale.

How can I implement this.

useEffect (() => {
    const language = localstorage.getItem ("Lang");
    if(language==="ar")
    {
        moment.locale("ar")
    }
    else
    {
        moment.locale("en")
    }
}, [])
about 4 years ago · Santiago Trujillo
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda