From 62b86bda5517df11734c60d57a6f293be6fbb5a4 Mon Sep 17 00:00:00 2001 From: dylan Date: Sat, 20 Mar 2021 12:50:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0max=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/iocoder/dashboard/util/date/DateUtils.java | 10 ++++++++++ 1 file changed, 10 insertions(+) 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; + } + }