1
0
Fork 0
mirror of synced 2024-10-02 10:08:09 +13:00

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

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,
})
)