Created
June 6, 2012 07:20
-
-
Save hugodotlau/2880403 to your computer and use it in GitHub Desktop.
Datetime comparing when validating a Yii form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function rules() | |
{ | |
return array( | |
array( | |
'end_time', | |
'compare', | |
'compareAttribute'=>'start_time', | |
'operator'=>'>', | |
'on'=>'insert', | |
'message'=>'Ending time should be greater than starting time' | |
), | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
from: http://sirink.tumblr.com/