From 16b50c3c20b511afe75a4a5d32545827beef3202 Mon Sep 17 00:00:00 2001 From: SebastianMC <23032356+SebastianMC@users.noreply.github.com> Date: Wed, 10 Jul 2024 12:06:01 +0200 Subject: [PATCH] #150 - Sort notes in dd-Mmm-yyyy format - completed, tested. --- src/custom-sort/matchers.ts | 2 +- src/test/unit/sorting-spec-processor.spec.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/custom-sort/matchers.ts b/src/custom-sort/matchers.ts index 52154c9..b92c65c 100644 --- a/src/custom-sort/matchers.ts +++ b/src/custom-sort/matchers.ts @@ -8,7 +8,7 @@ export const NumberRegexStr: string = ' *(\\d+)'; // Plain number export const CompoundNumberDotRegexStr: string = ' *(\\d+(?:\\.\\d+)*)'; // Compound number with dot as separator export const CompoundNumberDashRegexStr: string = ' *(\\d+(?:-\\d+)*)'; // Compound number with dash as separator -export const Date_dd_Mmm_yyyy_RegexStr: string = ' *[0-3]*[0-9]-(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-\\d{4}'; // Date like 01-Jan-2020 +export const Date_dd_Mmm_yyyy_RegexStr: string = ' *([0-3]*[0-9]-(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-\\d{4})'; // Date like 01-Jan-2020 export const DOT_SEPARATOR = '.' export const DASH_SEPARATOR = '-' diff --git a/src/test/unit/sorting-spec-processor.spec.ts b/src/test/unit/sorting-spec-processor.spec.ts index 81a80dc..3a7fbd1 100644 --- a/src/test/unit/sorting-spec-processor.spec.ts +++ b/src/test/unit/sorting-spec-processor.spec.ts @@ -407,7 +407,7 @@ const expectedSortSpecsExampleSortingSymbols: { [key: string]: CustomSortSpec } }, { type: CustomSortGroupType.ExactName, regexPrefix: { - regex: /^ *[0-3]*[0-9]-(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-\d{4} for the specific date format of 12\-Apr\-2024$/i, + regex: /^ *([0-3]*[0-9]-(?:Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-\d{4}) for the specific date format of 12\-Apr\-2024$/i, normalizerFn: Date_dd_Mmm_yyyy_NormalizerFn } }, {