DateCompare.php 540 B

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