ee.DateRange.intersects

Returns true if the given DateRange has at least one point in common with this DateRange.
UsageReturns
DateRange.intersects(other)Boolean
ArgumentTypeDetails
this: dateRangeDateRange
otherDateRange

Examples

Code Editor (JavaScript)

// A series of ee.DateRange objects.
var dateRange1 = ee.DateRange('2017-06-24', '2017-07-24');
var dateRange2 = ee.DateRange('2017-06-30', '2018-07-10');
var dateRange3 = ee.DateRange('1970-06-24', '1971-07-24');
var dateRange4 = ee.DateRange('2017-06-25', '2017-07-25');

// Determine if an ee.DateRange intersects another.
print('Does dateRange1 contain dateRange2?', dateRange1.intersects(dateRange2));
print('Does dateRange1 contain dateRange3?', dateRange1.intersects(dateRange3));
print('Does dateRange1 contain dateRange4?', dateRange1.intersects(dateRange4));