Commit 62b86bda5517df11734c60d57a6f293be6fbb5a4

Authored by dylan
1 parent 54378aee

增加max函数

src/main/java/cn/iocoder/dashboard/util/date/DateUtils.java
@@ -59,4 +59,14 @@ public class DateUtils { @@ -59,4 +59,14 @@ public class DateUtils {
59 return calendar.getTime(); 59 return calendar.getTime();
60 } 60 }
61 61
  62 + public static Date max(Date a, Date b) {
  63 + if (a == null) {
  64 + return b;
  65 + }
  66 + if (b == null) {
  67 + return a;
  68 + }
  69 + return a.compareTo(b) > 0 ? a : b;
  70 + }
  71 +
62 } 72 }