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

276
Visualizações
How can I properly use moment inside of pug?

I'm trying to use moment to format a date in PUG. This is my code:

  table(style='width:50%', border='2')
      tr
        th Event Title
        th Date
        th Coin
        th Name
        th Description
      each event in data.body
        tr
          td(style='text-align: center') #{event.title['en']}
          td(style='text-align: center') #{moment(event.date_event).format('YYYY-MM-DD')}
          td(style='text-align: center') #{event.coins[0].symbol}
          td(style='text-align: center') #{event.coins[0].name}

I've tried looking for examples here but I couldn't make it work with the ones I found. PS: I have the library installed and imported to all my local app files already.

Can anyone help me with that?

Cheers

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

app.locals.moment = require('moment');

or

script(src='moment.min.js')
over 4 years ago · Santiago Trujillo Relatório
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