@easyquery/enterprise 7.2.3-rc02 → 7.2.3-rc03

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.
@@ -898,24 +898,7 @@ var data_table_aggr_calculator_DataTableAggregatesCalculator = /** @class */ (fu
898
898
  for (var _i = 0, _a = this.aggregates; _i < _a.length; _i++) {
899
899
  var aggr = _a[_i];
900
900
  var columnTotals = levelTotals.columns[aggr.colId];
901
- switch (aggr.funcId) {
902
- case "SUM":
903
- groupTotals[aggr.colId] = columnTotals.sum;
904
- break;
905
- case "AVG":
906
- groupTotals[aggr.colId] = columnTotals.sum / levelTotals.count;
907
- break;
908
- case "COUNT":
909
- case "CNTDST":
910
- groupTotals[aggr.colId] = levelTotals.count;
911
- break;
912
- case "MIN":
913
- groupTotals[aggr.colId] = columnTotals.min;
914
- break;
915
- case "MAX":
916
- groupTotals[aggr.colId] = columnTotals.max;
917
- break;
918
- }
901
+ groupTotals[aggr.colId] = this.applyAggrFunc(aggr.funcId, columnTotals, levelTotals);
919
902
  }
920
903
  if (this.aggrSettings.hasRecordCount()) {
921
904
  groupTotals[this.aggrSettings.COUNT_FIELD_NAME] = levelTotals.count;
@@ -923,6 +906,21 @@ var data_table_aggr_calculator_DataTableAggregatesCalculator = /** @class */ (fu
923
906
  this.aggrContainer.updateAggregateData(levelIndex, groupKey, groupTotals);
924
907
  this.resetLevelTotals(levelTotals);
925
908
  };
909
+ DataTableAggregatesCalculator.prototype.applyAggrFunc = function (funcId, columnTotals, levelTotals) {
910
+ switch (funcId) {
911
+ case "SUM":
912
+ return columnTotals.sum;
913
+ case "AVG":
914
+ return columnTotals.sum / levelTotals.count;
915
+ case "COUNT":
916
+ case "CNTDST":
917
+ return levelTotals.count;
918
+ case "MIN":
919
+ return columnTotals.min;
920
+ case "MAX":
921
+ return columnTotals.max;
922
+ }
923
+ };
926
924
  /** Updates the totals by values in the current DataRow
927
925
  * and according to the specified aggregate
928
926
  */
@@ -3190,13 +3188,22 @@ var AggregationSettings = /** @class */ (function () {
3190
3188
  };
3191
3189
  //returns true if value1 == value2
3192
3190
  AggregationSettings.prototype.strictCompare = function (value1, value2) {
3193
- return value1 === value2;
3191
+ if (value1 instanceof Date) {
3192
+ return value1.getTime() === value2.getTime();
3193
+ }
3194
+ else
3195
+ return value1 === value2;
3194
3196
  };
3195
3197
  //makes a case insensative comparision of two values and return true if there are equal
3196
3198
  AggregationSettings.prototype.caseInsensitiveCompare = function (value1, value2) {
3197
- var val1 = (typeof value1 === 'string') ? value1.toLowerCase() : value1;
3198
- var val2 = (typeof value2 === 'string') ? value2.toLowerCase() : value2;
3199
- return val1 === val2;
3199
+ if (value1 instanceof Date) {
3200
+ return value1.getTime() === value2.getTime();
3201
+ }
3202
+ else {
3203
+ var val1 = (typeof value1 === 'string') ? value1.toLowerCase() : value1;
3204
+ var val2 = (typeof value2 === 'string') ? value2.toLowerCase() : value2;
3205
+ return val1 === val2;
3206
+ }
3200
3207
  };
3201
3208
  return AggregationSettings;
3202
3209
  }());