DateTimeRule.php 478 B

1234567891011121314151617181920212223
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Class DateTimeRule
  5. * @author Julio Montoya
  6. */
  7. class DateTimeRule extends HTML_QuickForm_Rule
  8. {
  9. /**
  10. * Check a date
  11. *
  12. * @param string $date example 2014-04-30 18:00
  13. * @param array $options
  14. *
  15. * @return boolean True if date is valid
  16. * @see HTML_QuickForm_Rule
  17. */
  18. public function validate($date, $options)
  19. {
  20. return api_is_valid_date($date, 'Y-m-d H:i');
  21. }
  22. }