Browse Source

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

pull/4434/head
Andrew Kingston 4 years ago
parent
commit
358aed6d4f
  1. 3
      packages/string-templates/src/index.js

3
packages/string-templates/src/index.js

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

Loading…
Cancel
Save