feat: support timezone offset argument for date filter, #553

This commit is contained in:
Jun Yang
2022-11-27 13:46:51 +08:00
parent cd918ccb85
commit 7a714855df
2 changed files with 9 additions and 4 deletions
+3
View File
@@ -61,6 +61,9 @@ describe('filters/date', function () {
it('should offset UTC date literal', function () {
return test('{{ "1990-12-31T23:00:00Z" | date: "%Y-%m-%dT%H:%M:%S"}}', '1990-12-31T17:00:00', undefined, opts)
})
it('should support timezone offset argument', function () {
return test('{{ "1990-12-31T23:00:00Z" | date: "%Y-%m-%dT%H:%M:%S", 360}}', '1990-12-31T17:00:00')
})
it('should offset date literal with timezone 00:00 specified', function () {
return test('{{ "1990-12-31T23:00:00+00:00" | date: "%Y-%m-%dT%H:%M:%S"}}', '1990-12-31T17:00:00', undefined, opts)
})