eykrehbein / strest

⚡️ CI-ready tests for REST APIs configured in YAML
MIT License
1.74k stars 59 forks source link

Added support for Using Moment.js in the nunjuck templates #139

Closed shrikster closed 5 years ago

shrikster commented 5 years ago

Fixing #119

This PR defines a date filter for Nunjucks implementing moment.js, a rich date manager. The moment library proposes a large set of date formats you can use to customize the filter output. It also embeds a huge set of methods to manipulate dates. Any of these methods can be called using the filter, passing as many arguments as needed (see example above).

for example <$ '2019-10-10' | date('YYYY') $> or <$ content.creation_date | date $>

ora latest version (3.2) comes with its own type definition so no need for @types/ora anymore plus a small typo fix in the readme .. *paramter

jgroom33 commented 5 years ago

very nice!

jgroom33 commented 5 years ago

I'll bump the version and release an update

vcollado commented 4 years ago

I'll bump the version and release an update

@jgroom33 Is there any plan to release this any soon?

Where using the date filter, it throws

 Template render error: (unknown path) [Line 2, Column 36]
  Error: filter not found: date