Validate 'date' object
@param {Date} date
@returns {Boolean}
514816
function isValid(date) {
  return Object.prototype.toString.call(date) == '[object Date]' && !isNaN(date.getTime());
}
539801
def valid_date(key, config_date):
    
    key_date = "/".join(key.split("/")[4:7])
    return parse_date(key_date) > parse_date(config_date)
681718
public static function isDate($date): bool
    {
        if (!\preg_match('/^([\d]{4})-((?:0?[\d])|(?:1[0-2]))-((?:0?[\d])|(?:[1-2][\d])|(?:3[01]))( [\d]{2}:[\d]{2}:[\d]{2})?$/',
            $date, $matches)) {
            return false;
        }

        return \checkdate((int)$matches[2], (int)$matches[3], (int)$matches[1]);
    }
520931
public static boolean isValidDate(final String date, final String format, final boolean lenient)
	{
		boolean isValid = true;
		if (date == null || format == null || format.length() <= 0)
		{
			return false;
		}
		try
		{
			final DateFormat df = new SimpleDateFormat(format);
			df.setLenient(lenient);
			df.parse(date);
		}
		catch (final ParseException | IllegalArgumentException e)
		{
			isValid = false;
		}
		return isValid;
	}
725728
function isDate(thing) {
  return Object.prototype.toString.call(thing) === '[object Date]'
          && !isNaN(thing.getTime());
}
734415
function parseDate(value) {
  let date = value;
  if (!value) {
    return new Date().getTime();
  }
  if (isObject(date)) {
    date = date.value || date;
  }
  // array
  if (isArray(date)) {
    date = new Date(...date).getTime();
  } else {
    // string number  null 、''、undefined
    date = new Date(date).getTime();
  }
  if (date) {
    return date;
  }
  console.warn('Invalid Date ', value);
  return new Date().getTime();
}
536354
function getValidDate (y, m, d, h, i, s, ms) {
  var date = new Date(y, m - 1, d, h, i, s, ms);
  if (
      y  === date.getFullYear()  &&
      m  === date.getMonth() + 1 &&
      d  === date.getDate()      &&
      h  === date.getHours()     &&
      i  === date.getMinutes()   &&
      s  === date.getSeconds()   &&
      ms === date.getMilliseconds()
  ) {
    return date;
  } else {
    return null;
  }
}
421052
function fixInvalidDate(dateString) {
  if (!dateString) {
    return;
  }

  //Convert invalid dates' timezones to GMT using timezoneMap
  dateString = dateString.replace(/BST?/i, function (match) {
    return timezoneMap[match];
  });

  //Some dates come in as ET, CT etc.. and some don't have the correct offset.
  //Matches /ET/EDT/EST/CT/CDT/CST/MT/MDT/MST/PT/PDT/PST if found at the end of a date string
  var newDateString = dateString.replace(/(E|C|M|P)[DS+]?T$/i, function (match) {
    var firstChar = match.charAt(0);
    return isDaylightSavingsTime() ? (firstChar + 'DT') : (firstChar + 'ST');
  });

  return new Date(newDateString);
}
1133940
static public function validate($date)
    {
      // Check if date is a string
      if(is_string($date) && strlen(trim($date)) > 0)
        return false;
        
      // Check if date matches pattern
      if(!preg_match('/^' . self::PATTERN . '$/', $date, $matches))
        return false;
          
      // Extract values from date
      list($original, $year, $month, $day) = $matches;
          
      // Check if all values are valid
      if(!self::validateDate($year, $month, $day))
        return false;
            
      return true;
    }
587212
function(inst, date) {
		var minDate = this._getMinMaxDate(inst, 'min');
		var maxDate = this._getMinMaxDate(inst, 'max');
		return ((!minDate || date.getTime() >= minDate.getTime()) &&
			(!maxDate || date.getTime() <= maxDate.getTime()));
	}
52684
def _validate_date_str(str_):
    """"""

    if not str_:
        return None

    # Convert to datetime so we can validate it's a real date that exists then
    # convert it back to the string.
    try:
        date = datetime.strptime(str_, DATE_FMT)
    except ValueError:
        msg = 'Invalid date format, should be YYYY-MM-DD'
        raise argparse.ArgumentTypeError(msg)

    return date.strftime(DATE_FMT)
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)
27041
function (date, pattern) {
                if (ariaUtilsType.isDate(date)) {
                    return aria.utils.Date.format(date, pattern);
                } else {
                    this.$logError(aria.templates.Modifiers.DATEFORMAT_MODIFIER_ENTRY, [date]);
                }
            }
982411
function tzdate (date) {
  var match;
  if (match = /^TZ="(\S+)"\s+(.*)$/.exec(date)) {
    var a = match.slice(1, 3).reverse();
    return a;
  }
  return date;
}
1083260
@SuppressWarnings("unchecked")
    public T date( Date... date ) {
        if (checkIfNull(date)) {
            return (T) this;
        }
        date = ensureDateNotTimestamp(date);
        addObjectParameter(DATE_LIST, "date", date);
        return (T) this;
    }
23903
public static function validateDateBasic($date, $format = self::FORMAT): bool
    {
        $object = DateTime::createFromFormat($format, $date);

        return $object && $object->format($format) === $date;
    }
866187
function() {
        var _date = {
            year: 			0,
            month: 			1, // stupid JS dates
            day: 			1,
            hour: 			0,
            minute: 		0,
            second: 		0,
            millisecond: 	0
		};

		// Merge data
		TL.Util.mergeData(_date, this.data);

 		// Make strings into numbers
		var DATE_PARTS = TL.Date.DATE_PARTS;

 		for (var ix in DATE_PARTS) {
 		    var x = TL.Util.trim(_date[DATE_PARTS[ix]]);
 		    if (!x.match(/^-?\d*$/)) {
 		        throw new TL.Error("invalid_date_err", DATE_PARTS[ix] + " = '" + _date[DATE_PARTS[ix]] + "'");
 		    }
 		    
			var parsed = parseInt(_date[DATE_PARTS[ix]]);
			if (isNaN(parsed)) {
                parsed = (ix == 4 || ix == 5) ? 1 : 0; // month and day have diff baselines
            }
			_date[DATE_PARTS[ix]] = parsed;
		}

		if (_date.month > 0 && _date.month <= 12) { // adjust for JS's weirdness
			_date.month = _date.month - 1;
		}

		return _date;
    }