diff --git a/framework/core/js/src/common/query/discussions/CreatedGambit.ts b/framework/core/js/src/common/query/discussions/CreatedGambit.ts index 1b84ed044d..087196165d 100644 --- a/framework/core/js/src/common/query/discussions/CreatedGambit.ts +++ b/framework/core/js/src/common/query/discussions/CreatedGambit.ts @@ -2,7 +2,7 @@ import IGambit from '../IGambit'; export default class CreatedGambit implements IGambit { pattern(): string { - return 'created:(\\d{4}\\-\\d\\d\\-\\d\\d(?:\\.\\.\\d{4}\\-\\d\\d\\-\\d\\d))?'; + return 'created:(\\d{4}\\-\\d\\d\\-\\d\\d(?:\\.\\.(\\d{4}\\-\\d\\d\\-\\d\\d))?)'; } toFilter(matches: string[], negate: boolean): Record { diff --git a/framework/core/js/tests/unit/common/GambitManager.test.ts b/framework/core/js/tests/unit/common/GambitManager.test.ts index 50e40ed104..d27e1a6146 100644 --- a/framework/core/js/tests/unit/common/GambitManager.test.ts +++ b/framework/core/js/tests/unit/common/GambitManager.test.ts @@ -25,9 +25,9 @@ test('gambits are only applied for the correct resource type', function () { q: 'lorem created:2023-07-07 is:hidden author:behz', email: 'behz@machine.local', }); - expect(gambits.apply('discussions', { q: 'lorem created:2023-07-07 is:hidden -author:behz email:behz@machine.local' })).toStrictEqual({ + expect(gambits.apply('discussions', { q: 'lorem created:2023-07-07..2023-10-18 is:hidden -author:behz email:behz@machine.local' })).toStrictEqual({ q: 'lorem email:behz@machine.local', - created: '2023-07-07', + created: '2023-07-07..2023-10-18', hidden: true, '-author': ['behz'], });