'This is not a valid date' ); /** * Checks whether the given value is a valid date. Also sets * the error message if not. * * @param $value The value to check * @return boolean True if valid false otherwise */ public function isValid($value) { if (is_array($value) && isset($value['day'], $value['month'], $value['year']) && is_numeric($value['day']) && is_numeric($value['month']) && is_numeric($value['year']) && checkdate((int) $value['month'], (int) $value['day'], (int) $value['year']) ) { return true; } $this->addMessage($this->_messageTemplates['invalid']); return false; } }