Date.php 514 B

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