ルールのあるモデルがあります
public function rules() {
return array(
array('user_id, name, start_date, timezones, start_hours, return_date, return_hours, location_start, location_end, trip_activity, trip_mean, status', 'required'),
array('user_id, return_hours, sign_off, saved, advise, time_notification, status', 'numerical', 'integerOnly'=>true),
array('name, going_with, start_hours, location_start, location_end, location_return, trip_activity, trip_mean', 'length', 'max'=>255),
array('created, modified, advise, notify_best_friend, notify_now, notify_returning, send_notification, sign_off', 'safe'),
array('going_with, location_return, time_notification, created, modified', 'default', 'setOnEmpty' => true, 'value' => null),
array('id, user_id, name, going_with, start_date, start_hours, return_date, return_hours, location_start, location_end, location_return, trip_activity, trip_mean, saved, advise, time_notification, status, created, modified', 'safe', 'on'=>'search'),
array(
'return_date',
'compare',
'compareAttribute'=>'start_date',
'operator'=>'>=',
'allowEmpty'=>false ,
'message'=>'{attribute} must be greater than "{compareValue}".'
),
array(
'return_hours',
'compare',
'compareAttribute'=>'start_hours',
'operator'=>'>',
'allowEmpty'=>false ,
'message'=>'{attribute} must be greater than "{compareValue}".'
),
);
}
日付と時刻を比較したい...
場合: 'return_date' >= 'start_date'... 大丈夫です。
'return_date' == 'start_date' の場合、'return_hours > 'start_hours' ですが、上記のルールでは比較できません。
解決策は?ありがとう!