File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
opensearch/src/main/java/org/opensearch/sql/opensearch/data/type Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -229,13 +229,15 @@ private ExprCoreType getExprTypeFromCustomFormatString(String formatString) {
229
229
boolean isTime = false ;
230
230
231
231
try {
232
+ // Dates will always have "year" in the formatter string
232
233
isDate = formats .stream ()
233
234
.anyMatch (format -> DateTimeFormatter .ofPattern (format ).toString ().toLowerCase ().contains ("year" ));
234
235
} catch (IllegalArgumentException ignore ) {
235
236
}
236
237
try {
238
+ // Times will always have "hour" in the formatter string
237
239
isTime = formats .stream ()
238
- .anyMatch (format -> DateTimeFormatter .ofPattern (formatString ).toString ().toLowerCase ().contains ("minute " ));
240
+ .anyMatch (format -> DateTimeFormatter .ofPattern (format ).toString ().toLowerCase ().contains ("hour " ));
239
241
} catch (IllegalArgumentException ignore ) {
240
242
}
241
243
You can’t perform that action at this time.
0 commit comments