diff --git a/src/main/java/cn/iocoder/dashboard/util/date/DateUtils.java b/src/main/java/cn/iocoder/dashboard/util/date/DateUtils.java index 3ae810982..fde10fd1f 100644 --- a/src/main/java/cn/iocoder/dashboard/util/date/DateUtils.java +++ b/src/main/java/cn/iocoder/dashboard/util/date/DateUtils.java @@ -59,4 +59,14 @@ public class DateUtils { return calendar.getTime(); } + public static Date max(Date a, Date b) { + if (a == null) { + return b; + } + if (b == null) { + return a; + } + return a.compareTo(b) > 0 ? a : b; + } + }