Apply a validation test to each date provided.
@private
@param value {string} The current field value.
@param elem {Element} The field control.
@return {boolean} <code>true</code> if OK, <code>false</code> if failed validation.
502928
function validateEach(value, elem) {
			var inst = $.calendarsPicker._getInst(elem);
			var dates = (inst.options.multiSelect ? value.split(inst.options.multiSeparator) :
				(inst.options.rangeSelect ? value.split(inst.options.rangeSeparator) : [value]));
			var ok = (inst.options.multiSelect && dates.length <= inst.options.multiSelect) ||
				(!inst.options.multiSelect && inst.options.rangeSelect && dates.length === 2) ||
				(!inst.options.multiSelect && !inst.options.rangeSelect && dates.length === 1);
			if (ok) {
				try {
					var dateFormat = inst.get('dateFormat');
					var minDate = inst.get('minDate');
					var maxDate = inst.get('maxDate');
					var cp = $(elem);
					$.each(dates, function(i, v) {
						dates[i] = inst.options.calendar.parseDate(dateFormat, v);
						ok = ok && (!dates[i] || (cp.calendarsPicker('isSelectable', dates[i]) &&
							(!minDate || dates[i].compareTo(minDate) !== -1) &&
							(!maxDate || dates[i].compareTo(maxDate) !== +1)));
					});
				}
				catch (e) {
					ok = false;
				}
			}
			if (ok && inst.options.rangeSelect) {
				ok = (dates[0].compareTo(dates[1]) !== +1);
			}
			return ok;
		}
1014308
def validate_element(self, value):
        
        # If value is str is it considered valid.  Satisfies "required=True".
        if isinstance(value, bytes):
            try:
                six.text_type(value, 'UTF-8')
            except UnicodeDecodeError as err:
                try:
                    _ = self.name
                except AttributeError:
                    validation_error = ValidationError(
                        'Field encountered non-UTF-8 string %r: %s' % (value,
                                                                       err))
                else:
                    validation_error = ValidationError(
                        'Field %s encountered non-UTF-8 string %r: %s' % (
                            self.name, value, err))
                    validation_error.field_name = self.name
                raise validation_error
        else:
            return super(StringField, self).validate_element(value)
        return value
1069422
function ( obj ) {
		return obj.nodeName === "FORM" ? false : validate.test( {alphanum  : obj.value || element.text( obj )} ).pass;
	}
1222922
def _validate(self, value):
        
        if value is None and not self.nullable:
            self.ctx.errors.invalid('not nullable')
            return False
        return True
102767
function(value) {
        switch (typeof value) {
            case 'boolean':
                return 'Boolean';

            case 'number':
                return 'Number';

            case 'string':
                return 'String';

            case 'object':
                if (value === null) {
                    return 'Null';
                } else {
                    switch (Object.prototype.toString.call(value)) {
                        case '[object RegExp]':
                            return 'RegExp';

                        case '[object Array]':
                            return 'Array';

                        case '[object Object]':
                            switch (value.constructor) {
                                case JuttleMoment:
                                    if (value.moment) {
                                        return 'Date';
                                    }
                                    if (value.duration) {
                                        return 'Duration';
                                    }
                                    break;   // silence ESLint

                                case Filter:
                                    return 'Filter';

                                case Object:
                                    return 'Object';
                            }
                    }
                }
        }

        throw new Error('Invalid Juttle value: ' + value + '.');
    }
980471
function check (value) {
  var validator = Validator();
  var checker = Object.create(Check, {
    value: {enumerable: true, value: value},
    validator: {enumerable: true, value: validator}
  });
  return checker;
}
503646
function (value) {
            if (value == null) {
                value = this._getText();
            }

            // _getText only handles valid / invalid values and prefills, not the helptext
            if (!value && !this._isPassword) {
                // We don't want to handle helptext in password fields, first remove any text
                this.getTextInputField().value = "";
                this.setHelpText(true);
            } else if (value) {
                this.setHelpText(false);
                this.getTextInputField().value = value;
            }
        }
471204
function(el, value)
	{
		// TODO Restrict to text input fields?
		
		if (el.cbRestrict)
		{
			el.removeEventListener('keypress', el.cbRestrict);
		}
		
		el.cbRestrict = function(event)
		{
			if (event.ctrlKey)
			{
				return;
			}
			
			var code = event.keyCode || event.which;
			var char = event.key || String.fromCharCode(code);
			var regExp = value;
				
			if (!conbo.isRegExp(regExp))
			{
				regExp = new RegExp('['+regExp+']', 'g');
			}
			
			if (!char.match(regExp))
			{
				event.preventDefault();
			}
		};
		
		el.addEventListener('keypress', el.cbRestrict);
	}
408903
@Override
    public ValidationResult validate(Object value) {
        if (value == null || value instanceof String) {
            return new ValidationResult.ValidationPassed();
        } else {
            return new ValidationResult.ValidationFailed("Value \"" + value + "\" is not a valid string!");
        }
    }
1341959
@Override
	public boolean isValid(Object value, ConstraintValidatorContext constraintContext) {

		// Si l'objet est null
		if(value == null) return false;
		
		// Si on a un Calendar
		if(value instanceof Calendar) {
			
			// On caste
			Calendar calendar = (Calendar) value;
			
			// On évalue
			return calendar.getTime().before(new Date());
		}

		// Si on a un Date
		if(value instanceof Date) {
			
			// On caste
			Date date = (Date) value;
			
			// On évalue
			return date.before(new Date());
		}
		
		// Si l'objet n'est pas de type date (On l'ignore en retournant true - Comme s'il n'ya eu aucun test)
		return true;
	}
266962
def validate(self, value):
        """"""
        if value is not None:
            if not isinstance(value, list):
                raise ValidationError("field must be a list")

            for index, element in enumerate(value):
                try:
                    self.inner.validate(element)
                except ValidationError as error:
                    raise ValidationError("invalid element {}: {}".format(
                        index,
                        error.args[0],
                    ))

        super().validate(value)
1069326
function (value) {

            if (!Array.isArray(value)) {

                // null/undefined or anything else must be safely convert to string

                value = value + '';
            }

            if (Array.isArray(value)) {

                // map all values again
                value = value.map(v => this.parseValue(v));

            } else if (validator.isNumeric(value)) {

                value = value * 1; // parse as a number

            } else if (validator.isBoolean(value)) {

                value = (value === 'true');

            } else {

                // convert to JS date
                const date = validator.toDate(value);

                // date is valid, assign
                if (date !== null) {

                    value = date;
                }

                if (value === 'null') {

                    value = null;
                }

                if (value === 'undefined') {

                    value = undefined;
                }
            }

            return value;
        }
568233
function (value, elem) {
        var tmpl = elem.firstElementChild
        elem.removeChild(tmpl)

        value.forEach(function (text) {
            var clone = tmpl.cloneNode(true)
            clone.textContent = text
            elem.appendChild(clone)
        })
    }
705463
function validate (schema, data, key) {
  let value = data[key]
  const bool = value == null || value === ''
  const { required, type, validate, transform, elements } = schema
  const def = schema['default']
  // trigger error if undefined but required
  if (required && bool) throw new Error(`field ${key} is missing`)
  // coerce to type
  if (type && !bool) {
    let before = coerce(type, key, value)
    data[key] = elements
      ? (type === 'object' ? validator(before, elements) : before.map(item => validator(item, elements)))
      : before
  }
  // validate value
  if (validate) {
    const cb = check(validate, key)
    if (type === 'array') value.map(cb)
    else cb(value)
  }
  // apply default value
  if (def && bool) data[key] = def
  // apply transform
  if (transform && def == null) {
    data[key] = typeof transform === 'function'
      ? (type === 'array' ? value.map(transform) : transform(value))
      : transform
  }
}
933596
function( value, element, param ) {
			if ( this.optional(element) ) {
				return "dependency-mismatch";
			}

			var previous = this.previousValue(element),
				validator, data;

			if (!this.settings.messages[element.name] ) {
				this.settings.messages[element.name] = {};
			}
			previous.originalMessage = this.settings.messages[element.name].remote;
			this.settings.messages[element.name].remote = previous.message;

			param = typeof param === "string" && { url: param } || param;

			if ( previous.old === value ) {
				return previous.valid;
			}

			previous.old = value;
			validator = this;
			this.startRequest(element);
			data = {};
			data[element.name] = value;
			$.ajax($.extend(true, {
				url: param,
				mode: "abort",
				port: "validate" + element.name,
				dataType: "json",
				data: data,
				context: validator.currentForm,
				success: function( response ) {
					var valid = response === true || response === "true",
						errors, message, submitted;

					validator.settings.messages[element.name].remote = previous.originalMessage;
					if ( valid ) {
						submitted = validator.formSubmitted;
						validator.prepareElement(element);
						validator.formSubmitted = submitted;
						validator.successList.push(element);
						delete validator.invalid[element.name];
						validator.showErrors();
					} else {
						errors = {};
						message = response || validator.defaultMessage( element, "remote" );
						errors[element.name] = previous.message = $.isFunction(message) ? message(value) : message;
						validator.invalid[element.name] = true;
						validator.showErrors(errors);
					}
					previous.valid = valid;
					validator.stopRequest(element, valid);
				}
			}, param));
			return "pending";
		}
987225
def is_date(property_name, *, format=None, present_optional=False, message=None):
    """"""
    # NOTE: Not currently using format param
    def check(val):
      """Checks that a value can be parsed as a date."""
      if val is None:
        return present_optional
      else:
        is_date, _ = util.try_parse_date(val)
        return is_date

    return Validation(check, property_name, message)
289365
function (name, value) {
    if (DOMProperty.isReservedProp(name)) {
      return false;
    }
    if ((name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {
      return false;
    }
    if (value === null) {
      return true;
    }
    switch (typeof value) {
      case 'boolean':
        return DOMProperty.shouldAttributeAcceptBooleanValue(name);
      case 'undefined':
      case 'number':
      case 'string':
      case 'object':
        return true;
      default:
        // function, symbol
        return false;
    }
  }