Date.php 518 B

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