You are here

private static function MerciHours::periodDates in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.3

Returns start and end date for a year or month period.

2 calls to MerciHours::periodDates()
MerciHours::getClosedDays in merci_hours/includes/entity.inc
Returns a list of closed days for the requested year or month.
MerciHours::getOpenDays in merci_hours/includes/entity.inc
Returns a list of opening days for the requested year or month.

File

merci_hours/includes/entity.inc, line 97

Class

MerciHours
Define a WorkCalendar object with its operations.

Code

private static function periodDates($year, $month = NULL) {
  if (is_null($month)) {
    $start = "{$year}-01-01 00:00:00";
    $end = "{$year}-12-31 00:00:00";
  }
  else {
    $start = "{$year}-{$month}-01 00:00:00";
    $days = date_days_in_month($year, $month);
    $end = "{$year}-{$month}-{$days} 00:00:00";
  }
  return array(
    $start,
    $end,
  );
}