Skip to content

Commit

Permalink
Merge pull request #1502 from JeroenSfdc/patch-10
Browse files Browse the repository at this point in the history
Update CollectionProcessorsUtils.cls
  • Loading branch information
alexed1 authored Dec 21, 2023
2 parents 202fc44 + f1f6f6c commit d1d9b19
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public with sharing class CollectionProcessorsUtils {

if (fieldType == 'datetime' || fieldType == 'date') {
//Datetime is already formatted
if (fieldValue.contains('t') && fieldValue.contains('z') && fieldValue.indexOf('t') == 11) {
if (fieldValue.containsIgnoreCase('t') && fieldValue.containsIgnoreCase('z') && fieldValue.indexOfIgnoreCase('t') == 10) {
return fieldValue;
}
Map<String, String> localMonthNumbers = getLocalMonthNumbers();
Expand Down Expand Up @@ -68,15 +68,16 @@ public with sharing class CollectionProcessorsUtils {
}

//Workaround to get local month name to month number map
@TestVisible
private static Map<String, String> getLocalMonthNumbers() {
Datetime dt = Datetime.newInstance(2020, 1, 1);
Datetime dt = Datetime.newInstance(2020, 1, 15);

Map<String, String> resultMap = new Map<String, String>();
for (Integer i = 1; i < 12; i++) {
for (Integer i = 1; i < 13; i++) {
resultMap.put(dt.format('MMMM').toLowerCase(), String.valueOf(i));
dt = dt.addMonths(1);
}
return resultMap;
}

}
}

0 comments on commit d1d9b19

Please sign in to comment.