Skip to content

Commit e35f957

Browse files
committed
Allow date parameters to be passed as numeric strings
1 parent 2f97982 commit e35f957

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

dist/fng-reports.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! forms-angular 2025-02-09 */
1+
/*! forms-angular 2025-07-13 */
22
'use strict';
33

44
formsAngular.controller('AnalysisCtrl', ['$rootScope', '$window', '$q', '$filter', '$scope', '$http', '$location', 'CssFrameworkService', 'RoutingService', 'uiGridConstants',
@@ -266,8 +266,12 @@ ${e.message}`);
266266
function toTextValue(obj, conversionExpression) {
267267
let retVal;
268268
if (!(obj instanceof Date)) {
269-
if (typeof obj === 'string' && obj.match(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3} \d{4}/)) {
270-
obj = new Date(obj.replace(' ', '+'));
269+
if (typeof obj === 'string') {
270+
if (obj.match(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3} \d{4}$/)) {
271+
obj = new Date(obj.replace(' ', '+'));
272+
} else if (obj.match(/^\d{13}$/)) {
273+
obj = new Date(parseInt(obj, 10));
274+
}
271275
}
272276
}
273277
if (obj instanceof Date) {
@@ -398,7 +402,7 @@ ${e.message}`);
398402
$scope.gridOptions.showColumnFooter = true;
399403
colDef.aggregationType = uiGridConstants.aggregationTypes[colDef.aggregationTypeStr];
400404
if (!colDef.aggregationType) {
401-
colDef.aggregationType = function() {return eval(colDef.aggregationTypeStr)};
405+
colDef.aggregationType = function() {return eval(colDef.aggregationTypeStr);};
402406
}
403407
colDef.aggregationHideLabel = colDef.aggregationTypeStr === 'sum';
404408
colDef.footerCellFilter = colDef.cellFilter;

0 commit comments

Comments
 (0)