You are here

function rooms_end_of_month_dates in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7

Utility function that returns the last day of each month given a year.

Parameters

int $year: The year to get the end of month dates for

Return value

array An array keyed by months

7 calls to rooms_end_of_month_dates()
RoomsEvent::transformToMonthlyEvents in includes/rooms.event.inc
Takes a single event that spans several months and transforms it to monthly events - this assumes that the event is contained within a year
rooms_availability_generate_json in modules/rooms_availability/rooms_availability.module
Generates json based on date range provided.
rooms_pricing_json in modules/rooms_pricing/rooms_pricing.module
Creates the necessary json for the date range provided.
UnitCalendar::getRawDayData in modules/rooms_availability/includes/rooms_availability.unit_calendar.inc
Given a date range it returns all data within that range including the start and end dates of states. The MySQL queries are kept simple and then the data is cleared up.
UnitCalendar::prepareFullMonthArray in modules/rooms_availability/includes/rooms_availability.unit_calendar.inc
Given an event it prepares the entire month array for it assuming no other events in the month and days where there is no event get set to the default state.

... See full list

File

./rooms.module, line 811
Provides basic underlying functionality and configuration options used by all Rooms modules

Code

function rooms_end_of_month_dates($year) {
  $end_of_month_dates = array();
  for ($i = 1; $i <= 12; $i++) {
    $end_of_month_dates[$i] = date("t", mktime(0, 0, 0, $i, 1, $year));
  }
  return $end_of_month_dates;
}