DateTimeRule.php 490 B

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