Browse Source

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

pull/4434/head
Andrew Kingston 5 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, { const template = instance.compile(string, {
strict: false, strict: false,
}) })
const now = Math.floor(Date.now() / 1000) * 1000
return processors.postprocess( return processors.postprocess(
template({ template({
now: new Date().toISOString(), now: new Date(now).toISOString(),
...context, ...context,
}) })
) )

Loading…
Cancel
Save