You are here

function _archive_validate_day in Archive 5

Check if given year, month and date combination is valid for a Drupal archive.

Parameters

$year: The year to check

$month: The month to check

$day: The day to check

Return value

TRUE or FALSE

2 calls to _archive_validate_day()
_archive_date in ./archive.module
Parses the current URL and populates an archive date object with the selected date information.
_archive_url in ./archive.module
Generate an archive URL based on the $y, $m and $d provided, falling back on the $date properties if an invalid date is specified.

File

./archive.module, line 107

Code

function _archive_validate_day($year, $month, $day) {
  if (_archive_validate_month($month) && _archive_validate_year($year)) {

    // Number of days for that month
    $last = gmdate('t', gmmktime(0, 0, 0, $month, 1, $year));
    return 1 <= $day && $day <= $last;
  }
  else {
    return FALSE;
  }
}