Get an array of domain start dates

@param  int|Date date A random date included in the wanted domain
@param  int|Date range Number of dates to get, or a stop date
@return Array of dates
178951
function(date, range) {
		"use strict";

		if (typeof date === "number") {
			date = new Date(date);
		}

		if (arguments.length < 2) {
			range = this.options.range;
		}

		switch(this.options.domain) {
		case "hour" :
			var domains = this.getHourDomain(date, range);

			// Case where an hour is missing, when passing from standard time to DST
			// Missing hour is perfectly acceptabl in subDomain, but not in domains
			if (typeof range === "number" && domains.length < range) {
				if (range > 0) {
					domains.push(this.getHourDomain(domains[domains.length-1], 2)[1]);
				} else {
					domains.shift(this.getHourDomain(domains[0], -2)[0]);
				}
			}
			return domains;
		case "day"  :
			return this.getDayDomain(date, range);
		case "week" :
			return this.getWeekDomain(date, range);
		case "month":
			return this.getMonthDomain(date, range);
		case "year" :
			return this.getYearDomain(date, range);
		}
	}
886822
public function get(string $date = null) : array
    {
        if ($date === null) {
            $date = \date('Y-m-d');
        }

        return [
            'queued' => $this->queue->count(),
            'pass' => $this->queue->getStatsByType($date, 'pass'),
            'fail' => $this->queue->getStatsByType($date, 'fail'),
            'retry' => $this->queue->getStatsByType($date, 'retry'),
            'cancel' => $this->queue->getStatsByType($date, 'cancel')
        ];
    }
124121
public Date[] asRange(String beginClock, String endClock) {
		String thisDay = null;
		return new Date[]{of((thisDay = (asDayText() + " ")) + beginClock).get(), of(thisDay + endClock).get()};
	}
749950
public static Date beginOfWeek(@NotNull final Date date) {
		return DateUtils.truncate(DateUtil.subDays(date, DateUtil.getDayOfWeek(date) - 1), Calendar.DATE);
	}
953537
public static @Nullable Date mostRecent(Date @NotNull... dates) {
    Date mostRecentDate = null;
    for (Date date : dates) {
      if (date != null && (mostRecentDate == null || date.after(mostRecentDate))) {
        mostRecentDate = date;
      }
    }
    return mostRecentDate;
  }
935433
def parse(date)
			return date if date.kind_of?(self)
			r=[]
			dates = date.to_s.chomp.split(/,\s*/)
			dates.each do |d|
				r << d.split(/\s*->\s*/).map {|i| i == ":now" ? :now : i }
			end
			return DateRange.new(r)
		end
783458
public int getRemainingDays(String startDate, String endDate, Date currentDate) throws java.text.ParseException {
		DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");

		Calendar iterationEndDate = Calendar.getInstance();
		iterationEndDate.setTime(dateFormat.parse(endDate));

		Calendar iterationStartDate = Calendar.getInstance();
		iterationStartDate.setTime(dateFormat.parse(startDate));

		Calendar currentCalendarDate = Calendar.getInstance();
		currentCalendarDate.setTime(currentDate);

		int remainingDays = 0;

		if ((iterationStartDate.compareTo(currentCalendarDate) == 1)
				|| (iterationEndDate.compareTo(currentCalendarDate) == -1)) {

			return remainingDays;
		}

		while (iterationEndDate.compareTo(currentCalendarDate) == 1) {
			if ((currentCalendarDate.get(Calendar.DAY_OF_WEEK) != Calendar.SATURDAY)
					&& (currentCalendarDate.get(Calendar.DAY_OF_WEEK) != Calendar.SUNDAY)) {
				++remainingDays;
			}
			currentCalendarDate.add(Calendar.DAY_OF_MONTH, 1);
		}

		return remainingDays;
	}
535713
def from_ad_date(cls, date):
        
        functions.check_valid_ad_range(date)
        days = values.START_EN_DATE - date

        # Add the required number of days to the start nepali date
        start_date = NepDate(values.START_NP_YEAR, 1, 1)
        # No need to update as addition already calls update
        return start_date + (date - values.START_EN_DATE)
1325990
public static List<LocalDate> untilDays(String startDate, String endDate) {
        return untilDays(parse(startDate, DEFAULT_PATTERN), parse(endDate, DEFAULT_PATTERN));
    }
155268
public function getEmails($start = 0, $range = 10)
    {
        Argument::i()
            ->test(1, 'int')
            ->test(2, 'int');

        $total = $this->getEmailTotal();

        if ($total == 0) {
            return array();
        }

        if (!is_array($start)) {
            $range = $range > 0 ? $range : 1;
            $start = $start >= 0 ? $start : 0;
            $max = $total - $start;

            if ($max < 1) {
                $max = $total;
            }

            $min = $max - $range + 1;

            if ($min < 1) {
                $min = 1;
            }

            $set = $min . ':' . $max;

            if ($min == $max) {
                $set = $min;
            }
        }

        $emails = array();
        for ($i = $min; $i <= $max; $i++) {
            $emails[] = $this->getEmailFormat($this->call('RETR '.$i, true));
        }

        return $emails;
    }
1055556
public static DateTime date(Date date) {
		if (date instanceof DateTime) {
			return (DateTime) date;
		}
		return dateNew(date);
	}
631274
def dates(date_range)
      if date_range.is_a? String

        # assume the user knows what she is doing if passed a string
        @query[:params][:date] = date_range
      elsif date_range.is_a? Range
        start = date_range.first
        last = date_range.last
        @query[:params][:date] = "#{start.strftime("%YM%m")}:#{last.strftime("%YM%m")}"
      end
      self
    end
451558
public static List<Date> toDateList(final List<Calendar> dates) {
        return dates.stream().map(Calendar::getTime).collect(Collectors.toList());
    }
1181223
private List<Date> getListOfMarkerDateBetWeenTwoDates(final Date startDate, final Date endDate) {

			final List<Date> listOfMarkerDate = new LinkedList<>();

			final Calendar startDateAsCal = toGregorianCalendar(startDate);
			final Calendar endDateAsCal = toGregorianCalendar(endDate);

			while (startDateAsCal.before(endDateAsCal)) {
				listOfMarkerDate.add(getMarkerDateOfMonth(startDateAsCal.getTime()));
				startDateAsCal.add(Calendar.MONTH, 1);
			}

			return listOfMarkerDate;
        }
1089093
public static function getStartEndMonth() : array
    {
        date_default_timezone_set('UTC');
        $begin = mktime(0, 0, 0, date('m'), 1, date("Y"));
        $end = mktime(23, 59, 59, date('m'), date("t"), date("Y"));
        return [
            'begin' => $begin,
            'end' => $end
        ];
    }
535651
static protected function regex($date)
    {
      if(!preg_match('/^' . self::PATTERN . '$/', $date, $matches))
        throw new InvalidArgumentException(__METHOD__ . '; Invalid date, no match with pattern (' . $date . ')');
        
      return $matches;
    }
127446
public static Date beginOfDate(@NotNull final Date date) {
		return DateUtils.truncate(date, Calendar.DATE);
	}