DateCompare.php 525 B

123456789101112131415161718192021
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Class HTML_QuickForm_Rule_DateCompare
  5. * @author Julio Montoya
  6. */
  7. class HTML_QuickForm_Rule_DateCompare extends HTML_QuickForm_Rule_Compare
  8. {
  9. /**
  10. * Validate 2 dates
  11. * @param array $values Array with the 2 dates.
  12. * @param $operator
  13. *
  14. * @return boolean true if the 2 given dates match the operator
  15. */
  16. function validate($values, $operator = null)
  17. {
  18. return api_strtotime($values[0]) < api_strtotime($values[1]);
  19. }
  20. }