Date.php 501 B

12345678910111213141516171819202122
  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. * @see HTML_QuickForm_Rule
  12. * @param string $date example 2014-04-30
  13. * @param array $options
  14. *
  15. * @return boolean True if date is valid
  16. */
  17. public function validate($date, $options)
  18. {
  19. return api_is_valid_date($date, 'Y-m-d');
  20. }
  21. }