From 4bfee587f1ea5a770c761fe55676d4af600cea8a Mon Sep 17 00:00:00 2001 From: Darin Kelkhoff Date: Tue, 26 Jul 2022 16:39:45 -0500 Subject: [PATCH] Add LocalDate to LocalDate --- .../com/kingsrook/qqq/backend/core/utils/ValueUtils.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/kingsrook/qqq/backend/core/utils/ValueUtils.java b/src/main/java/com/kingsrook/qqq/backend/core/utils/ValueUtils.java index 2b529349..9f582d2b 100644 --- a/src/main/java/com/kingsrook/qqq/backend/core/utils/ValueUtils.java +++ b/src/main/java/com/kingsrook/qqq/backend/core/utils/ValueUtils.java @@ -198,6 +198,10 @@ public class ValueUtils { return (null); } + else if(value instanceof LocalDate ld) + { + return (ld); + } else if(value instanceof java.sql.Date d) { return d.toLocalDate(); @@ -227,12 +231,12 @@ public class ValueUtils } else { - throw (new IllegalArgumentException("Unsupported class " + value.getClass().getName() + " for converting to BigDecimal.")); + throw (new IllegalArgumentException("Unsupported class " + value.getClass().getName() + " for converting to LocalDate.")); } } catch(Exception e) { - throw (new QValueException("Value [" + value + "] could not be converted to an BigDecimal.", e)); + throw (new QValueException("Value [" + value + "] could not be converted to an LocalDate.", e)); } }