| Constructor and Description |
|---|
DateRangeUtils() |
| Modifier and Type | Method and Description |
|---|---|
static List<DateRange> |
compliment(DateRange e1,
DateRange e2)
|
static boolean |
contains(DateRange e1,
DateRange e2)
Check if e1 contains e2 completely; including bounds
|
static long |
daysDiff(DateRange range,
boolean normalizeTime)
Calculate number of days difference.
Note on Time Zone : It is very important to note that both the date should have the same JVM Time-Zone set in the Date. |
static DateRange |
intersection(DateRange e1,
DateRange e2)
Get the overlap of event e1 in e2, including bound conditions
Example: If there are 2 Date ranges |
static boolean |
intersects(DateRange e1,
DateRange e2)
Check if 2 Date Ranges Overlap; including bounds
|
public static long daysDiff(DateRange range, boolean normalizeTime)
range - as DateRangenormalizeTime - as boolean, if true will ignore any time settings.public static DateRange intersection(DateRange e1, DateRange e2)
|e1S<-----x--------->e1E|
|e2S<---------y----->e2E|
This function will calculate (x,y) in the above scenario.
e1 - as DateRangee2 - as DateRangeAbstractEvent part. If e1 is not overlapping with e2 at all, it will throw an IllegalArgumentException.public static boolean intersects(DateRange e1, DateRange e2)
public static boolean contains(DateRange e1, DateRange e2)
Copyright © 2018. All rights reserved.