function cmfcCalendarV1Thai::isDateValid in Calendar Systems 8
Same name and namespace in other branches
- 8.2 calendar/v1/calendarSystems/thai.class.inc.php \cmfcCalendarV1Thai::isDateValid()
- 6 calendar/v1/calendarSystems/thai.class.inc.php \cmfcCalendarV1Thai::isDateValid()
- 7 calendar/v1/calendarSystems/thai.class.inc.php \cmfcCalendarV1Thai::isDateValid()
- 7.2 calendar/v1/calendarSystems/thai.class.inc.php \cmfcCalendarV1Thai::isDateValid()
Overrides cmfcCalendarV1Plugin::isDateValid
File
- calendar/
v1/ calendarSystems/ thai.class.inc.php, line 175
Class
Code
function isDateValid($month, $day, $year) {
$month = (int) $month;
$day = (int) $day;
$year = (int) $year - 543;
$timestamp = parent::mktime(10, 10, 10, $month, $day, $year);
if ($month < 1 || $month > 12) {
return FALSE;
}
if ($year < 1970 || $year > date('Y', $timestamp)) {
return FALSE;
}
if ($day < 1 || $day > date('t', $timestamp)) {
return FALSE;
}
return TRUE;
}