Skip to content

Commit 09910c5

Browse files
committed
case-insensitive partial dates
1 parent 119ba71 commit 09910c5

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

core/src/main/resources/fieldCalculation.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ var FieldCalculation = FieldCalculation || {};
6666
'customMonthNumberToName' : ['JAN','FEB','MÄR','APR','MAI','JUN','JUL','AUG','SEP','OKT','NOV','DEZ'],
6767
'customDateSeparator' : '-',
6868
'customTimeSeparator' : ':',
69-
'customPartialDatePartRegExp' : /NK|NA|ND/,
70-
'customPartialTimePartRegExp' : /NK|NA|ND/
69+
'customPartialDatePartRegExp' : /NK|NA|ND/i,
70+
'customPartialTimePartRegExp' : /NK|NA|ND/i
7171
};
7272
localizedMessages['en'] = {
7373
'errorSectionIndex' : "%s - %s (index %d)%s%s",
@@ -124,8 +124,8 @@ var FieldCalculation = FieldCalculation || {};
124124
'customMonthNumberToName' : ['JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC'],
125125
'customDateSeparator' : '-',
126126
'customTimeSeparator' : ':',
127-
'customPartialDatePartRegExp' : /NK|NA|ND/,
128-
'customPartialTimePartRegExp' : /NK|NA|ND/
127+
'customPartialDatePartRegExp' : /NK|NA|ND/i,
128+
'customPartialTimePartRegExp' : /NK|NA|ND/i
129129
};
130130

131131
function _cloneJSON(obj) {
@@ -1193,8 +1193,8 @@ var FieldCalculation = FieldCalculation || {};
11931193
}
11941194
m = ary[1].replace(regexp,nkMonth);
11951195
m_nk = true;
1196-
} else if (ary[1] in customMonthNameToNumberMap) {
1197-
m = customMonthNameToNumberMap[ary[1]];
1196+
} else if (ary[1].toUpperCase() in customMonthNameToNumberMap) {
1197+
m = customMonthNameToNumberMap[ary[1].toUpperCase()];
11981198
} else {
11991199
if (_testFunction(error)) {
12001200
error('month not regognized');

web/src/main/webapp/resources/js/fieldCalculation.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ var FieldCalculation = FieldCalculation || {};
6666
'customMonthNumberToName' : ['JAN','FEB','MÄR','APR','MAI','JUN','JUL','AUG','SEP','OKT','NOV','DEZ'],
6767
'customDateSeparator' : '-',
6868
'customTimeSeparator' : ':',
69-
'customPartialDatePartRegExp' : /NK|NA|ND/,
70-
'customPartialTimePartRegExp' : /NK|NA|ND/
69+
'customPartialDatePartRegExp' : /NK|NA|ND/i,
70+
'customPartialTimePartRegExp' : /NK|NA|ND/i
7171
};
7272
localizedMessages['en'] = {
7373
'errorSectionIndex' : "%s - %s (index %d)%s%s",
@@ -124,8 +124,8 @@ var FieldCalculation = FieldCalculation || {};
124124
'customMonthNumberToName' : ['JAN','FEB','MAR','APR','MAY','JUN','JUL','AUG','SEP','OCT','NOV','DEC'],
125125
'customDateSeparator' : '-',
126126
'customTimeSeparator' : ':',
127-
'customPartialDatePartRegExp' : /NK|NA|ND/,
128-
'customPartialTimePartRegExp' : /NK|NA|ND/
127+
'customPartialDatePartRegExp' : /NK|NA|ND/i,
128+
'customPartialTimePartRegExp' : /NK|NA|ND/i
129129
};
130130

131131
function _cloneJSON(obj) {
@@ -1193,8 +1193,8 @@ var FieldCalculation = FieldCalculation || {};
11931193
}
11941194
m = ary[1].replace(regexp,nkMonth);
11951195
m_nk = true;
1196-
} else if (ary[1] in customMonthNameToNumberMap) {
1197-
m = customMonthNameToNumberMap[ary[1]];
1196+
} else if (ary[1].toUpperCase() in customMonthNameToNumberMap) {
1197+
m = customMonthNameToNumberMap[ary[1].toUpperCase()];
11981198
} else {
11991199
if (_testFunction(error)) {
12001200
error('month not regognized');
@@ -2077,7 +2077,7 @@ var FieldCalculation = FieldCalculation || {};
20772077
function _inputFieldApplyCalculatedValue(variableName, index) {
20782078
var inputFieldVariable = _getSeriesInputFieldVariable(variableName, index, false);
20792079
if (inputFieldVariable) {
2080-
inputFieldVariable.enteredValue = _cloneJSON(inputFieldVariable.value);
2080+
inputFieldVariable.enteredValue = _cloneJSON( inputFieldVariable.value);
20812081
inputFieldVariable.delta = !_equalInputFieldVariable(inputFieldVariable);
20822082
if (FIELD_CALCULATION_DEBUG_LEVEL >= 1) {
20832083
console.log("apply calculated value " + _debugVarName(inputFieldVariable));
@@ -2367,12 +2367,12 @@ var FieldCalculation = FieldCalculation || {};
23672367
FieldCalculation.timestampApplyCalculatedValue = timestampApplyCalculatedValue;
23682368
FieldCalculation.timeApplyCalculatedValue = timeApplyCalculatedValue;
23692369
FieldCalculation.sketchApplyCalculatedValue = sketchApplyCalculatedValue;
2370-
2370+
23712371
FieldCalculation.getScriptAjax = _getScriptAjax;
23722372
FieldCalculation.getScript = _getScriptAjax;
23732373

23742374
_exportExpressionUtils(FieldCalculation);
2375-
2375+
23762376
if (FIELD_CALCULATION_DEBUG_LEVEL >= 1) {
23772377
console.log("field calculation utilities loaded");
23782378
}

0 commit comments

Comments
 (0)