From c99238c8b1e027099b2cd3f4b31b4c0b06d488d0 Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 29 Jun 2023 14:59:29 -0400 Subject: made recording annotation undoable. fixed doc filters for dates, change filter to use :: instead of : --- src/fields/Doc.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/fields') diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index c9f7e4114..f13dab68c 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -1430,6 +1430,8 @@ export namespace Doc { } } + export const FilterSep = '::'; + // filters document in a container collection: // all documents with the specified value for the specified key are included/excluded // based on the modifiers :"check", "x", undefined @@ -1439,7 +1441,7 @@ export namespace Doc { const childFilters = StrListCast(container[filterField]); runInAction(() => { for (let i = 0; i < childFilters.length; i++) { - const fields = childFilters[i].split(':'); // split key:value:modifier + const fields = childFilters[i].split(FilterSep); // split key:value:modifier if (fields[0] === key && (fields[1] === value || modifiers === 'match' || (fields[2] === 'match' && modifiers === 'remove'))) { if (fields[2] === modifiers && modifiers && fields[1] === value) { if (toggle) modifiers = 'remove'; @@ -1454,7 +1456,7 @@ export namespace Doc { container[filterField] = undefined; } else if (modifiers !== 'remove') { !append && (childFilters.length = 0); - childFilters.push(key + ':' + value + ':' + modifiers); + childFilters.push(key + FilterSep + value + FilterSep + modifiers); container[filterField] = new List(childFilters); } }); -- cgit v1.2.3-70-g09d2