mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
Added documentation for date ordinals support in date filter via %q (#581)
* Added date ordinals support in date filter via %q * fix: validation regex for default date format * fix: validation regex for default date format
This commit is contained in:
+2
-1
@@ -375,7 +375,8 @@ describe('Issues', function () {
|
||||
})
|
||||
const tpl = `{{ 'now' | date }}`
|
||||
const html = await liquid.parseAndRender(tpl)
|
||||
expect(html).to.match(/\w+, January \d+, 2023 at \d+:\d\d [ap]m [-+]\d\d\d\d/)
|
||||
// sample: Thursday, February 2, 2023 at 6:25 pm +0000
|
||||
expect(html).to.match(/\w+, \w+ \d+, \d\d\d\d at \d+:\d\d [ap]m [-+]\d\d\d\d/)
|
||||
})
|
||||
it('#575 Add support for Not operator', async () => {
|
||||
const liquid = new Liquid()
|
||||
|
||||
@@ -7,7 +7,8 @@ describe('filters/date', function () {
|
||||
return test('{{ date | date:"%a %b %d %Y"}}', { date }, date.toDateString())
|
||||
})
|
||||
it('should support "now"', function () {
|
||||
return test('{{ "now" | date }}', /\w+, January \d+, 2023 at \d+:\d\d [ap]m [-+]\d\d\d\d/)
|
||||
// sample: Thursday, February 2, 2023 at 6:25 pm +0000
|
||||
return test('{{ "now" | date }}', /\w+, \w+ \d+, \d\d\d\d at \d+:\d\d [ap]m [-+]\d\d\d\d/)
|
||||
})
|
||||
it('should create a new Date when given "now"', function () {
|
||||
return test('{{ "now" | date: "%Y"}}', (new Date()).getFullYear().toString())
|
||||
|
||||
Reference in New Issue
Block a user