You are here

function cmfcCalendarV1Iranian::isDateValid in Calendar Systems 8.2

Same name and namespace in other branches
  1. 8 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::isDateValid()
  2. 5 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::isDateValid()
  3. 6.3 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::isDateValid()
  4. 6 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::isDateValid()
  5. 7.3 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::isDateValid()
  6. 7 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::isDateValid()
  7. 7.2 calendar/v1/calendarSystems/iranian.class.inc.php \cmfcCalendarV1Iranian::isDateValid()

Overrides cmfcCalendarV1Plugin::isDateValid

File

calendar/v1/calendarSystems/iranian.class.inc.php, line 619

Class

cmfcCalendarV1Iranian

Code

function isDateValid($month, $day, $year) {
  $j_days_in_month = array(
    31,
    31,
    31,
    31,
    31,
    31,
    30,
    30,
    30,
    30,
    30,
    29,
  );
  $result = FALSE;
  if ($month <= 12 && $month > 0 && $day > 0) {
    if ($j_days_in_month[$month - 1] >= $day) {
      $result = TRUE;
    }
    if ($this
      ->isKabise($year) && $month == 12 && $j_days_in_month[$month - 1] + 1 == $day) {
      $result = TRUE;
    }
  }
  return $result;
}