Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

270
Views
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 answers
Answer question

0

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

or

script(src='moment.min.js')
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!