Update {{ now }} HBS helper to floor to the second instead of millisecond

This commit is contained in:
Andrew Kingston 2022-01-20 19:37:01 +00:00
parent 2394f7faee
commit 358aed6d4f
1 changed files with 2 additions and 1 deletions

View File

@ -112,9 +112,10 @@ module.exports.processStringSync = (string, context, opts) => {
const template = instance.compile(string, {
strict: false,
})
const now = Math.floor(Date.now() / 1000) * 1000
return processors.postprocess(
template({
now: new Date().toISOString(),
now: new Date(now).toISOString(),
...context,
})
)