fix: support timezoneOffset for date from scope, #401

This commit is contained in:
Harttle
2021-10-06 15:45:41 +08:00
parent 4f6b88c154
commit fd5ef474c3
11 changed files with 132 additions and 53 deletions
+6
View File
@@ -108,4 +108,10 @@ describe('Issues', function () {
const html = await engine.parseAndRender(tpl)
expect(html).to.equal('\r\ntrue\r\n')
})
it('#401 Timezone Offset Issue', async () => {
const engine = new Liquid({ timezoneOffset: -600 })
const tpl = engine.parse('{{ date | date: "%Y-%m-%d %H:%M %p %z" }}')
const html = await engine.render(tpl, { date: '2021-10-06T15:31:00+08:00' })
expect(html).to.equal('2021-10-06 17:31 PM +1000')
})
})