@aubrey
To properly use Moment.js inside of Pug, you can include the Moment.js library in your project and then use it within your Pug templates. Here is an example of how you can use Moment.js inside of a Pug template:
1
|
script(src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.1/moment.min.js") |
1
|
p The current date is: #{moment().format('MMMM Do YYYY, h:mm:ss a')} |
This will display the current date and time in the specified format.
1
|
p Next week's date is: #{moment().add(7, 'days').format('MMMM Do YYYY')} |
This will display the date that is one week from the current date.
By following these steps, you can properly use Moment.js inside of Pug for formatting and manipulating dates in your templates.