You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
490 B
25 lines
490 B
<?php
|
|
/* For licensing terms, see /license.txt */
|
|
|
|
/**
|
|
* Class DateTimeRule.
|
|
*
|
|
* @author Julio Montoya
|
|
*/
|
|
class DateTimeRule extends HTML_QuickForm_Rule
|
|
{
|
|
/**
|
|
* Check a date.
|
|
*
|
|
* @param string $date example 2014-04-30 18:00
|
|
* @param array $options
|
|
*
|
|
* @return bool True if date is valid
|
|
*
|
|
* @see HTML_QuickForm_Rule
|
|
*/
|
|
public function validate($date, $options)
|
|
{
|
|
return api_is_valid_date($date, 'Y-m-d H:i');
|
|
}
|
|
}
|
|
|