/** * Returns the Field Rules, to validate users input * * @param type $rules * @return type */ public function getFieldRules($rules = array()) { $rules[] = [$this->profileField->internal_name . "_hide_year", 'in', 'range' => [0, 1]]; $rules[] = [$this->profileField->internal_name, \humhub\libs\DbDateValidator::className(), 'format' => Yii::$app->formatter->dateInputFormat, 'convertToFormat' => null, 'max' => time(), 'tooBig' => Yii::t('base', 'The date has to be in the past.')]; return parent::getFieldRules($rules); }
/** * Returns the Field Rules, to validate users input * * @param type $rules * @return type */ public function getFieldRules($rules = array()) { $rules[] = array($this->profileField->internal_name, DbDateValidator::className(), 'format' => Yii::$app->params['formatter']['defaultDateFormat']); return parent::getFieldRules($rules); }
public function rules() { return array([['title'], 'required'], [['max_users', 'percent'], 'integer'], [['deadline'], \humhub\libs\DbDateValidator::className(), 'format' => Yii::$app->params['formatter']['defaultDateFormat']], [['max_users', 'assignedUserGuids'], 'safe']); }
/** * @inheritdoc */ public function rules() { return [[['title', 'start_datetime', 'end_datetime'], 'required'], [['start_time', 'end_time'], 'date', 'format' => 'php:H:i'], [['start_datetime'], DbDateValidator::className(), 'format' => Yii::$app->params['formatter']['defaultDateFormat'], 'timeAttribute' => 'start_time'], [['end_datetime'], DbDateValidator::className(), 'format' => Yii::$app->params['formatter']['defaultDateFormat'], 'timeAttribute' => 'end_time'], [['is_public', 'all_day'], 'boolean'], [['title'], 'string', 'max' => 200], [['participation_mode'], 'in', 'range' => [self::PARTICIPATION_MODE_ALL, self::PARTICIPATION_MODE_INVITE, self::PARTICIPATION_MODE_NONE]], [['end_datetime'], 'validateEndTime'], [['description'], 'safe']]; }
/** * @inheritdoc */ public function getFieldRules($rules = array()) { $rules[] = [$this->profileField->internal_name, DbDateValidator::className(), 'format' => Yii::$app->formatter->dateInputFormat, 'convertToFormat' => 'Y-m-d']; return parent::getFieldRules($rules); }
/** * Returns the Field Rules, to validate users input * * @param type $rules * @return type */ public function getFieldRules($rules = array()) { $rules[] = array($this->profileField->internal_name, DbDateValidator::className(), 'format' => self::DATEPICKER_FORMAT); return parent::getFieldRules($rules); }