Skip to content

Commit

Permalink
Changed check for time
Browse files Browse the repository at this point in the history
Signed-off-by: Guian Gumpac <[email protected]>
  • Loading branch information
GumpacG committed Jun 5, 2023
1 parent 467d033 commit 3b0c2d2
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,15 @@ private ExprCoreType getExprTypeFromCustomFormatString(String formatString) {
boolean isTime = false;

try {
// Dates will always have "year" in the formatter string
isDate = formats.stream()
.anyMatch(format -> DateTimeFormatter.ofPattern(format).toString().toLowerCase().contains("year"));
} catch (IllegalArgumentException ignore) {
}
try {
// Times will always have "hour" in the formatter string
isTime = formats.stream()
.anyMatch(format -> DateTimeFormatter.ofPattern(formatString).toString().toLowerCase().contains("minute"));
.anyMatch(format -> DateTimeFormatter.ofPattern(format).toString().toLowerCase().contains("hour"));
} catch (IllegalArgumentException ignore) {
}

Expand Down

0 comments on commit 3b0c2d2

Please sign in to comment.