diff --git a/CS2JLibrary/src/RusticiSoftware/System/DateTimeSupport.java b/CS2JLibrary/src/RusticiSoftware/System/DateTimeSupport.java index 55b2971..bb7b2eb 100755 --- a/CS2JLibrary/src/RusticiSoftware/System/DateTimeSupport.java +++ b/CS2JLibrary/src/RusticiSoftware/System/DateTimeSupport.java @@ -151,5 +151,17 @@ public class DateTimeSupport { cal.add(field, amount); return cal.getTime(); } + + public static boolean equals(Date d1, Date d2) { + return d1 == d2 || (d1 != null && d2 != null && d1.getTime() == d2.getTime()); + } + + // null == null, but otherwise all comparisons return false + public static boolean lessthan(Date d1, Date d2) { + return d1 != null && d2 != null && d1.before(d2); + } + public static boolean lessthanorequal(Date d1, Date d2) { + return d1 != null && d2 != null && (d1.before(d2) || equals(d1,d2)); + } } \ No newline at end of file