We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, I modified function clientValidateAttribute like this to validate sort of a "now" date:
// ... public function clientValidateAttribute($object, $attribute) { if ($this->compareValue !== null) { $compareTo = $this->compareValue; //AN81 BEG // $compareValue = CJSON::encode($this->compareValue); $compareValue = "(new Date('$this->compareValue'.replace(' ', 'T'))).getTime()"; //AN81 END }
rule is:
// ... array('start_date', // 'ext.date-compare.EDateCompare', 'ext.date-compare.ExtEDateCompare', // 'compareValue' => 'js:( new Date() ).getTime()', 'compareValue' => date(Yii::app()->params['dateFormat']), 'operator' => '>', 'message' => Yii::t('ui','Begin date must be after now.') ),
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello,
I modified function clientValidateAttribute like this to validate sort of a "now" date:
// ...
public function clientValidateAttribute($object, $attribute)
{
if ($this->compareValue !== null) {
$compareTo = $this->compareValue;
//AN81 BEG
// $compareValue = CJSON::encode($this->compareValue);
$compareValue = "(new Date('$this->compareValue'.replace(' ', 'T'))).getTime()";
//AN81 END
}
rule is:
// ...
array('start_date',
// 'ext.date-compare.EDateCompare',
'ext.date-compare.ExtEDateCompare',
// 'compareValue' => 'js:( new Date() ).getTime()',
'compareValue' => date(Yii::app()->params['dateFormat']),
'operator' => '>',
'message' => Yii::t('ui','Begin date must be after now.')
),
The text was updated successfully, but these errors were encountered: