|
|
|
@ -14,7 +14,7 @@ public class ESUtils {
|
|
|
|
|
.parseDefaulting(ChronoField.DAY_OF_MONTH, 1)
|
|
|
|
|
.toFormatter();
|
|
|
|
|
|
|
|
|
|
public static String getESFormatDate(String originalDate) {
|
|
|
|
|
public static String getESFormatDate(String originalDate) {
|
|
|
|
|
try{
|
|
|
|
|
LocalDate parsedDate = LocalDate.parse(originalDate, elasticSearchDateFormatter);
|
|
|
|
|
return parsedDate.format(elasticSearchDateFormatter);
|
|
|
|
@ -23,8 +23,12 @@ public class ESUtils {
|
|
|
|
|
LocalDate parsedDate = LocalDate.parse(originalDate, originalRecordDateFormatter);
|
|
|
|
|
return parsedDate.format(elasticSearchDateFormatter);
|
|
|
|
|
} catch (Exception e1) {
|
|
|
|
|
LocalDate parsedDate = LocalDate.parse(originalDate, yearOnlyDateFormatter);
|
|
|
|
|
return parsedDate.format(yearOnlyDateFormatter);
|
|
|
|
|
try {
|
|
|
|
|
LocalDate parsedDate = LocalDate.parse(originalDate.substring(0, 10), elasticSearchDateFormatter);
|
|
|
|
|
return parsedDate.format(elasticSearchDateFormatter);
|
|
|
|
|
} catch (Exception e2) {
|
|
|
|
|
return "0000";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|