Returns true if the val is valid for the date specified.

@param {Date} d: The date to check the value on
@param {Integer} val: The value to validate
508129
function(d, val) {
    return later.wm.val(d) === (val || later.wm.extent(d)[1]);
  }
28330
public static boolean isISODateTimeUTC(final String val) throws BadDateException {
    try {
      if (val.length() != 16) {
        return false;
      }
      fromISODateTimeUTC(val);
      return true;
    } catch (Throwable t) {
      return false;
    }
  }
1076667
function (event) {
      switch (attribute.type) {
        case 'Date':
          attribute.value = (input.value === '') ? null : attribute.coerce(input.value);
          if (attribute.value != null) {
            var mm = attribute.value.getMonth() + 1;
            var dd = attribute.value.getDate();
            var yyyy = attribute.value.getFullYear();
            if (mm < 10) mm = '0' + mm;
            if (dd < 10) dd = '0' + dd;
            input.value = mm + '/' + dd + '/' + yyyy;
          } else {
            input.value = '';
          }
          break;
        default:
          attribute.value = (input.value === '') ? null : attribute.coerce(input.value);
          if (attribute.value != null)
            input.value = attribute.value;
          break;
      }
      attribute.validate(function () {
      });
    }
597759
function(d, val) {
    return later.wy.val(d) === (val || later.wy.extent(d)[1]);
  }
356466
function parseNthDay(val) {
      var atoms = val.split('#');
      if (atoms.length > 1) {
        var nthValue = +atoms[atoms.length - 1];
        if(/,/.test(val)) {
          throw new Error('Constraint error, invalid dayOfWeek `#` and `,` '
            + 'special characters are incompatible');
        }
        if(/\//.test(val)) {
          throw new Error('Constraint error, invalid dayOfWeek `#` and `/` '
            + 'special characters are incompatible');
        }
        if(/-/.test(val)) {
          throw new Error('Constraint error, invalid dayOfWeek `#` and `-` '
            + 'special characters are incompatible');
        }
        if (atoms.length > 2 || safeIsNaN(nthValue) || (nthValue < 1 || nthValue > 5)) {
          throw new Error('Constraint error, invalid dayOfWeek occurrence number (#)');
        }
        
        options.nthDayOfWeek = nthValue;
        return atoms[0];
      }
      return val;
    }
1186833
function isDateType(value) {
    if (value) {
        var str = value.toString();
        return moment(new Date(value), "YYYY-M-D", true).isValid() || moment(value, "YYYY-M-D H:m:s", true).isValid() || moment(value, "YYYY/M/D H:m:s", true).isValid() || moment(value, "YYYY/M/D", true).isValid();
    };
    return false;
}
1287326
function(d, val) {
    val = val > later.dc.extent(d)[1] ? 1 : val;
    var month = later.date.nextRollover(d, val, later.dc, later.M),
        dcMax = later.dc.extent(month)[1];

    val = val > dcMax ? 1 : val;

    var next = later.date.next(
      later.Y.val(month),
      later.M.val(month),
      val === 0 ? later.D.extent(month)[1] - 6 : 1 + (7 * (val - 1))
    );

    if(next.getTime() <= d.getTime()) {
      month = later.M.next(d, later.M.val(d)+1);

      return later.date.next(
        later.Y.val(month),
        later.M.val(month),
        val === 0 ? later.D.extent(month)[1] - 6 : 1 + (7 * (val - 1))
      );
    }

    return next;
  }
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)
874791
function (val) {
            var rv = false;

            if (JS.isNumber(val)) {
                rv = val >= 0 && val < 100;
            }

            return rv;
        }
1374262
function(v,node){
                    var format = this.__dataset(node,'format')||'yyyy-MM-dd';
                    return !v||(!isNaN(this.__doParseDate(v)) && _u._$format(this.__doParseDate(v),format) == v);
                }
775928
def declared_date(self, value):
        
        if value:
            self._declared_date = parse(value).date() if isinstance(value, type_check) else value
671733
public static function isISODate($val)
    {
        if(!is_string($val)) {
            return false;
        }

        // Use DateTime support to check for valid dates.
        try
        {
            $date = new DateTime($val);
        }
        catch(Exception $e)
        {
            return false;
        }

        return true;
    }
605874
function getParsedDate(d, p) {
        var res, day;
        if ('string' === typeof d) {
            d = d === 'today' ? new Date() : new Date(d);
            // If invalid  date it return NaN.
            day = d.getDate();
            if (!day) return false;
        }
        try {
            res = {
                day: day || d.getDate(),
                month: d.getMonth() + 1,
                year: d.getFullYear(),
                obj: d
            };
        }
        catch(e) {
            return false;
        }
        res.str = (p.dayPos ? res.day + p.sep + res.month :
                   res.month + p.sep + res.day) + p.sep;
        res.str += p.yearDigits === 2 ? res.year.substring(3,4) : res.year;
        return res;
    }
201036
def _date_val(self, dt: datetime) -> None:
        
        self._tval_char = dt.strftime('%Y-%m-%d %H:%M')
        self._nval_num = (dt.year * 10000) + (dt.month * 100) + dt.day + \
                         (((dt.hour / 100.0) + (dt.minute / 10000.0)) if isinstance(dt, datetime) else 0)
847529
def _infer_fill_value(val):
    

    if not is_list_like(val):
        val = [val]
    val = np.array(val, copy=False)
    if is_datetimelike(val):
        return np.array('NaT', dtype=val.dtype)
    elif is_object_dtype(val.dtype):
        dtype = lib.infer_dtype(ensure_object(val), skipna=False)
        if dtype in ['datetime', 'datetime64']:
            return np.array('NaT', dtype=_NS_DTYPE)
        elif dtype in ['timedelta', 'timedelta64']:
            return np.array('NaT', dtype=_TD_DTYPE)
    return np.nan
1097216
def valid(self, value, level=[]):
		

		# Reset validation failures
		self.validation_failures = []

		# If the value is None and it's optional, we're good
		if value is None and self._optional:
			return True

		# If we are validating an ANY field, immediately return true
		if self._type == 'any':
			pass

		# If we are validating a DATE, DATETIME, IP or TIME data point
		elif self._type in ['base64', 'date', 'datetime', 'ip', 'md5', 'time', 'uuid']:

			# If it's a date or datetime type and the value is a python type
			if self._type == 'date' and isinstance(value, (datetime.date, datetime.datetime)):
				value = value.strftime('%Y-%m-%d')

			elif self._type == 'datetime' and isinstance(value, (datetime.date, datetime.datetime)):
				if isinstance(value, datetime.datetime):
					value = value.strftime('%Y-%m-%d %H:%M:%S')
				elif isinstance(value, datetime.date):
					value = '%s 00:00:00' % value.strftime('%Y-%m-%d')

			# If it's a time type and the value is a python type
			elif self._type == 'time' and isinstance(value, (datetime.time, datetime.datetime)):
				value = value.strftime('%H:%M:%S')

			# Else if the type is md5 and the value is a python type
			elif self._type == 'md5' and isinstance(value, _MD5_TYPE):
				value = value.hexdigest()

			# If the value is not a string
			elif not isinstance(value, basestring):
				self.validation_failures.append(('.'.join(level), 'not a string'))
				return False

			# If there's no match
			if not _typeToRegex[self._type].match(value):
				self.validation_failures.append(('.'.join(level), 'failed regex (internal)'))
				return False

			# If we are checking an IP
			if self._type == 'ip':

				# If there's a min or a max
				if self._minimum is not None or self._maximum is not None:

					# If the IP is greater than the maximum
					if self._maximum is not None and self.__compare_ips(value, self._maximum) == 1:
						self.validation_failures.append(('.'.join(level), 'exceeds maximum'))
						return False

					# If the IP is less than the minimum
					if self._minimum is not None and self.__compare_ips(value, self._minimum) == -1:
						self.validation_failures.append(('.'.join(level), 'did not meet minimum'))
						return False

					# Return OK
					return True

		# Else if we are validating some sort of integer
		elif self._type in ['int', 'timestamp', 'uint']:

			# If the type is a bool, fail immediately
			if type(value) == bool:
				self.validation_failures.append(('.'.join(level), 'is a bool'))
				return False

			# If it's not an int
			if not isinstance(value, (int, long)):

				# And it's a valid representation of an int
				if isinstance(value, basestring) \
					and _typeToRegex['int'].match(value):

					# If it starts with 0
					if value[0] == '0' and len(value) > 1:

						# If it's followed by X or x, it's hex
						if value[1] in ['x', 'X'] and len(value) > 2:
							value = int(value, 16)

						# Else it's octal
						else:
							value = int(value, 8)

					# Else it's base 10
					else:
						value = int(value)

				# Else, return false
				else:
					self.validation_failures.append(('.'.join(level), 'not an integer'))
					return False

			# If it's not signed
			if self._type in ['timestamp', 'uint']:

				# If the value is below 0
				if value < 0:
					self.validation_failures.append(('.'.join(level), 'signed'))
					return False

		# Else if we are validating a bool
		elif self._type == 'bool':

			# If it's already a bool
			if isinstance(value, bool):
				return True

			# If it's an int or long at 0 or 1
			if isinstance(value, (int, long)) and value in [0, 1]:
				return True

			# Else if it's a string
			elif isinstance(value, basestring):

				# If it's t, T, 1, f, F, or 0
				if value in ['true', 'True', 'TRUE', 't', 'T', '1', 'false', 'False', 'FALSE', 'f', 'F', '0']:
					return True
				else:
					self.validation_failures.append(('.'.join(level), 'not a valid string representation of a bool'))
					return False

			# Else it's no valid type
			else:
				self.validation_failures.append(('.'.join(level), 'not valid bool replacement'))
				return False

		# Else if we are validating a decimal value
		elif self._type == 'decimal':

			# If the type is a bool, fail immediately
			if type(value) == bool:
				self.validation_failures.append(('.'.join(level), 'is a bool'))
				return False

			# If it's already a Decimal
			if isinstance(value, Decimal):
				pass

			# Else if we fail to convert the value
			else:
				try: value = Decimal(value)
				except (DecimalInvalid, TypeError, ValueError):
					self.validation_failures.append(('.'.join(level), 'can not be converted to decimal'))
					return False

		# Else if we are validating a floating point value
		elif self._type == 'float':

			# If the type is a bool, fail immediately
			if type(value) == bool:
				self.validation_failures.append(('.'.join(level), 'is a bool'))
				return False

			# If it's already a float
			if isinstance(value, float):
				pass

			# Else if we fail to convert the value
			else:
				try: value = float(value)
				except (ValueError, TypeError):
					self.validation_failures.append(('.'.join(level), 'can not be converted to float'))
					return False

		# Else if we are validating a JSON string
		elif self._type == 'json':

			# If it's already a string
			if isinstance(value, basestring):

				# Try to decode it
				try:
					value = JSON.decode(value)
					return True
				except ValueError:
					self.validation_failures.append(('.'.join(level), 'Can not be decoded from JSON'))
					return False

			# Else
			else:

				# Try to encode it
				try:
					value = JSON.encode(value)
					return True
				except (ValueError, TypeError):
					self.validation_failures.append(('.'.join(level), 'Can not be encoded to JSON'))
					return False

		# Else if we are validating a price value
		elif self._type == 'price':

			# If the type is a bool, fail immediately
			if type(value) == bool:
				self.validation_failures.append(('.'.join(level), 'is a bool'))
				return False

			# If it's not a floating point value
			if not isinstance(value, Decimal):

				# But it is a valid string representing a price, or a float
				if isinstance(value, (basestring, float)) \
					and _typeToRegex['price'].match(str(value)):

					# Convert it to a decimal
					value = Decimal(value).quantize(Decimal('1.00'))

				# Else if it's an int
				elif isinstance(value, int):

					# Convert it to decimal
					value = Decimal(str(value) + '.00')

				# Else whatever it is is no good
				else:
					self.validation_failures.append(('.'.join(level), 'failed regex (internal)'))
					return False

			# Else
			else:

				# If the exponent is longer than 2
				if abs(value.as_tuple().exponent) > 2:
					self.validation_failures.append(('.'.join(level), 'too many decimal points'))
					return False

		# Else if we are validating a string value
		elif self._type == 'string':

			# If the value is not some form of string
			if not isinstance(value, basestring):
				self.validation_failures.append(('.'.join(level), 'is not a string'))
				return False

			# If we have a regex
			if self._regex:

				# If it doesn't match the regex
				if re.match(self._regex, value) == None:
					self.validation_failures.append(('.'.join(level), 'failed regex (custom)'))
					return False

			# Else
			elif self._minimum or self._maximum:

				# If there's a minimum length and we don't reach it
				if self._minimum and len(value) < self._minimum:
					self.validation_failures.append(('.'.join(level), 'not long enough'))
					return False

				# If there's a maximum length and we surpass it
				if self._maximum and len(value) > self._maximum:
					self.validation_failures.append(('.'.join(level), 'too long'))
					return False

				# Return OK
				return True

		# If there's a list of options
		if self._options is not None:

			# Returns based on the option's existance
			if value not in self._options:
				self.validation_failures.append(('.'.join(level), 'not in options'))
				return False
			else:
				return True

		# Else check for basic min/max
		else:

			# If the value is less than the minimum
			if self._minimum and value < self._minimum:
				self.validation_failures.append(('.'.join(level), 'did not meet minimum'))
				return False

			# If the value is greater than the maximum
			if self._maximum and value > self._maximum:
				self.validation_failures.append(('.'.join(level), 'exceeds maximum'))
				return False

		# Value has no issues
		return True
813386
function isPrimitive(value) {
  if (value === null) {
    return true
  }
  if (value === undefined) {
    return false
  }
  if (typeof value === 'function') {
    return false
  }
  if ([ 'boolean', 'number', 'string' ].indexOf(typeof value) !== -1) {
    return true
  }
  if (value instanceof Date || value instanceof ArrayBuffer) {
    return true
  }
  return false
}