tods-competition-factory 2.2.10 → 2.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +6 -6
- package/dist/tods-competition-factory.development.cjs.js +10 -3
- package/dist/tods-competition-factory.development.cjs.js.map +1 -1
- package/dist/tods-competition-factory.production.cjs.min.js +1 -1
- package/dist/tods-competition-factory.production.cjs.min.js.map +1 -1
- package/package.json +21 -21
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
function factoryVersion() {
|
|
6
|
-
return '2.2.
|
|
6
|
+
return '2.2.12';
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
const SINGLES_MATCHUP = 'SINGLES';
|
|
@@ -2478,8 +2478,10 @@ function getCategoryAgeDetails(params) {
|
|
|
2478
2478
|
let { ageCategoryCode, ageMaxDate, ageMinDate, ageMax, ageMin } = category;
|
|
2479
2479
|
const categoryName = category.categoryName;
|
|
2480
2480
|
let combinedAge;
|
|
2481
|
-
|
|
2482
|
-
|
|
2481
|
+
const isValidCategory = typeMatch([ageCategoryCode, ageMaxDate, ageMinDate, categoryName], 'string') &&
|
|
2482
|
+
allNumeric([ageMax, ageMin]) &&
|
|
2483
|
+
[ageMaxDate, ageMinDate].filter(Boolean).every(isValidDateString);
|
|
2484
|
+
if (!isValidCategory)
|
|
2483
2485
|
return { error: INVALID_CATEGORY };
|
|
2484
2486
|
const consideredDate = params.consideredDate ?? extractDate(new Date().toLocaleDateString('sv'));
|
|
2485
2487
|
if (!isValidDateString(consideredDate))
|
|
@@ -36421,6 +36423,11 @@ function scheduledSortedMatchUps({ schedulingProfile, matchUps = [] }) {
|
|
|
36421
36423
|
timeGroups[scheduledTime] = [];
|
|
36422
36424
|
timeGroups[scheduledTime].push(matchUp);
|
|
36423
36425
|
}
|
|
36426
|
+
for (const timeKey of Object.keys(timeGroups)) {
|
|
36427
|
+
const timeGroup = timeGroups[timeKey];
|
|
36428
|
+
const sortedTimeGroup = timeGroup.sort((a, b) => (a['roundNumber'] || 0) - (b['roundNumber'] || 0));
|
|
36429
|
+
timeGroups[timeKey] = sortedTimeGroup;
|
|
36430
|
+
}
|
|
36424
36431
|
const sortedTimeKeys = Object.keys(timeGroups).sort();
|
|
36425
36432
|
for (const scheduledTime of sortedTimeKeys) {
|
|
36426
36433
|
const timeGroup = timeGroups[scheduledTime];
|