diff --git a/docs/source/tutorials/differences.md b/docs/source/tutorials/differences.md index d5ba213b9..a8fb7ddaa 100644 --- a/docs/source/tutorials/differences.md +++ b/docs/source/tutorials/differences.md @@ -31,7 +31,9 @@ Though we're trying to be compatible with the Ruby version, there are still some * Trailing unmatched characters inside filters are allowed in shopify/liquid but not in LiquidJS. It means filter arguments without a colon like `{%raw%}{{ "a b" | split " "}}{%endraw%}` will throw an error in LiquidJS. This is intended to improve Liquid usability, see [#208][#208] and [#212][#212]. * LiquidJS has additional tags: [layout][layout] and corresponding `block` tag. * LiquidJS has additional filters: [json][json]. +* LiquidJS [date][date] filter supports `%q` for date ordinals like `{{ '2023/02/02' | date: '%d%q of %b'}}` => `02nd of Feb` +[date]: https://liquidjs.com/filters/date.html [layout]: https://liquidjs.com/tags/layout.html [json]: https://liquidjs.com/filters/json.html [#26]: https://github.com/harttle/liquidjs/pull/26 diff --git a/test/e2e/issues.ts b/test/e2e/issues.ts index 43e70e3b6..4cb7dd388 100644 --- a/test/e2e/issues.ts +++ b/test/e2e/issues.ts @@ -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() diff --git a/test/integration/filters/date.ts b/test/integration/filters/date.ts index ce8987cce..62123bf84 100644 --- a/test/integration/filters/date.ts +++ b/test/integration/filters/date.ts @@ -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())