Create a new DateRange with the datetimes converted to dates and changing to CLOSED/CLOSED.
546021
def as_dates(self):
        
        new_start = self.start.date() if self.start and isinstance(self.start, datetime.datetime) else self.start
        new_end = self.end.date() if self.end and isinstance(self.end, datetime.datetime) else self.end
        return DateRange(new_start, new_end, CLOSED_CLOSED)
1055556
public static DateTime date(Date date) {
		if (date instanceof DateTime) {
			return (DateTime) date;
		}
		return dateNew(date);
	}
890269
def set_range(self, start=None, end=None, occurrences=None):
        
        if start is None:
            if self.__start_date is None:
                self.__start_date = dt.date.today()
        else:
            self.start_date = start

        if end:
            self.end_date = end
        elif occurrences:
            self.__occurrences = occurrences
        self._track_changes()
1332046
public DateTime toDomain(Date from) {
        if (from == null) {
            return null;
        }
        return new DateTime(from.getTime());
    }
448028
public static DateTime truncate(Date date, DateField dateField) {
		return new DateTime(truncate(calendar(date), dateField));
	}
1257816
public void setEndTimes(java.util.Collection<DateTimeRange> endTimes) {
        if (endTimes == null) {
            this.endTimes = null;
            return;
        }

        this.endTimes = new java.util.ArrayList<DateTimeRange>(endTimes);
    }
979513
public static Generator<DateTime> pastDates(@Nonnull DateTime from) {
        return new RandomJodaDateTimeGenerator(ofInstance(checkNotNull(from)), new DurationFromNow(ZERO_DURAION));
    }
1226491
private void processRanges(List<DateRange> ranges, ProjectCalendarDateRanges container)
   {
      if (ranges != null)
      {
         for (DateRange range : ranges)
         {
            container.addRange(range);
         }
      }
   }
1015643
public static DateTime of(Date date) {
		if (date instanceof DateTime) {
			return (DateTime) date;
		}
		return new DateTime(date);
	}
122962
def _init_date_range(self, start_date=None, end_date=None):
        """"""
        self.end_date = end_date
        self.start_date = start_date
        if self.end_date is None:
            today = now_utc().date()
            end_date = self.event.end_dt.date()
            self.end_date = end_date if end_date < today else today
        if self.start_date is None:
            self.start_date = self.end_date - timedelta(days=ReportBase.default_report_interval)
1038667
public QueryChangesetsFilters byOpenSomeTimeBetween(Date createdBefore, Date closedAfter)
	{
		params.put("time", dateFormat.format(closedAfter) + "," + dateFormat.format(createdBefore));
		return this;
	}
1112997
def datetime_range(start_dt, end_dt, unit,
                   n_units=1, inclusive_end=False):
    """"""

    def done(a, b, inclusive_end):
        if inclusive_end:
            return a <= b
        else:
            return a < b

    current = start_dt
    while done(current, end_dt, inclusive_end):
        yield current
        current += datetime.timedelta(**{unit: n_units})
565845
def add_month(t: datetime, n: int=1) -> datetime:
    
    t2 = t
    for count in range(abs(n)):
        if n > 0:
            t2 = datetime(year=t2.year, month=t2.month, day=1) + timedelta(days=32)
        else:
            t2 = datetime(year=t2.year, month=t2.month, day=1) - timedelta(days=2)
        try:
            t2 = t.replace(year=t2.year, month=t2.month)
        except Exception:
            first, last = monthrange(t2.year, t2.month)
            t2 = t.replace(year=t2.year, month=t2.month, day=last)
    return t2
439880
public static DateInterval until(PlainDate end) {

        Boundary<PlainDate> past = Boundary.infinitePast();
        return new DateInterval(past, Boundary.of(CLOSED, end));

    }
254966
public static DateBetween create(Date begin, Date end, boolean isAbs) {
		return new DateBetween(begin, end, isAbs);
	}
944901
private static DateTimeFormatter createDateTimeFormatter(int dateStyle, int timeStyle){
        int type = DATETIME;
        if (dateStyle == NONE) {
            type = TIME;
        } else if (timeStyle == NONE) {
            type = DATE;
        }
        StyleFormatter llf = new StyleFormatter(dateStyle, timeStyle, type);
        return new DateTimeFormatter(llf, llf);
    }
715946
private static function cast(DateTimeRange $range)
	{
		$start = new Date($range->start());
		$end   = new Date($range->end());

		return new DateRange($start, $end);
	}