Check that left and right bounds are sane

        :param date: date to validate left/right bounds for
188356
def check_in_bounds(self, date):
        '''
        '''
        dt = Timestamp(date)
        return ((self._lbound is None or dt >= self._lbound) and
                (self._rbound is None or dt <= self._rbound))
239030
public static boolean validate(final String date) {

        Matcher matcher = PATTERN.matcher(date);

        if (matcher.matches()) {

            matcher.reset();

            if (matcher.find()) {

                int year = Integer.parseInt(matcher.group(1));
                String month = matcher.group(2);
                String day = matcher.group(3);

                if (day.equals("31") && (month.equals("4") || month.equals("6") || month.equals("9") || month
                        .equals("11") || month.equals("04") || month.equals("06") || month.equals("09"))) {
                    return false; // only 1,3,5,7,8,10,12 has 31 days
                } else if (month.equals("2") || month.equals("02")) {
                    // leap year
                    if (year % 4 == 0) {
                        return !(day.equals("30") || day.equals("31"));
                    } else {
                        return !(day.equals("29") || day.equals("30") || day.equals("31"));
                    }
                } else {
                    return true;
                }
            } else {
                return false;
            }
        } else {
            return false;
        }
    }
140578
def check_valid_bs_range(date):
    
    ERR_MSG = "%s out of range" % str(date)

    if date.year < values.START_NP_YEAR or date.year > values.END_NP_YEAR:
        raise ValueError(ERR_MSG)
    if date.month < 1 or date.month > 12:
        raise ValueError(ERR_MSG)
    if date.day < 1 or date.day > values.NEPALI_MONTH_DAY_DATA[date.year][date.month - 1]:
        raise ValueError(ERR_MSG)
    return True
856667
public boolean checkDate(Date date) {
		Calendar calendar = Calendar.getInstance();
		calendar.setTime(date);
		calendar.set(Calendar.HOUR_OF_DAY, 0);
		calendar.set(Calendar.MINUTE, 0);
		calendar.set(Calendar.SECOND, 0);
		calendar.set(Calendar.MILLISECOND, 0);

		Calendar minCal = Calendar.getInstance();
		minCal.setTime(minSelectableDate);
		minCal.set(Calendar.HOUR_OF_DAY, 0);
		minCal.set(Calendar.MINUTE, 0);
		minCal.set(Calendar.SECOND, 0);
		minCal.set(Calendar.MILLISECOND, 0);

		Calendar maxCal = Calendar.getInstance();
		maxCal.setTime(maxSelectableDate);
		maxCal.set(Calendar.HOUR_OF_DAY, 0);
		maxCal.set(Calendar.MINUTE, 0);
		maxCal.set(Calendar.SECOND, 0);
		maxCal.set(Calendar.MILLISECOND, 0);

		return !(calendar.before(minCal) || calendar.after(maxCal));
	}
775928
def declared_date(self, value):
        
        if value:
            self._declared_date = parse(value).date() if isinstance(value, type_check) else value
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;
    }
733188
function clampDate(date, minDate, maxDate) {
       var boundDate = date;
       if (minDate && date < minDate) {
         boundDate = new Date(minDate.getTime());
       }
       if (maxDate && date > maxDate) {
         boundDate = new Date(maxDate.getTime());
       }
       return boundDate;
     }
199548
public static int compare(Date left, Date right) {
	return compare(left.getTime() / 1000, right.getTime() / 1000);
    }
727221
def validate_iso_date key, value, opts
      if opts[:iso_date]
        return value.strftime("%Y-%m-%d")  if value.respond_to?(:strftime)
      end
      value
    end
391307
void left(Date dateLeft)
    {
        MeetMeUserState oldState;
        synchronized (this)
        {
            oldState = this.state;
            this.dateLeft = dateLeft;
            this.state = MeetMeUserState.LEFT;
        }
        firePropertyChange(PROPERTY_STATE, oldState, state);
    }
1142995
function isValidDate(date) {
  if (moment.isMoment(date)) {
    return date.isValid();
  } else {
    return moment(date).isValid();
  }
}
1240485
public static boolean adOrOver(Bound<?> left, Bound<?> right) {
        boolean isValueEqual = left.getValue().equals(right.getValue());
        boolean isBothOpen = left.getBoundaryType() == RangeBoundary.OPEN && right.getBoundaryType() == RangeBoundary.OPEN;
        return isValueEqual && !isBothOpen;
    }
381187
function isMonthWithinRange(date, minDate, maxDate) {
       var month = date.getMonth();
       var year = date.getFullYear();

       return (!minDate || minDate.getFullYear() < year || minDate.getMonth() <= month) &&
        (!maxDate || maxDate.getFullYear() > year || maxDate.getMonth() >= month);
     }
153456
def is_date(v) -> (bool, date):
        
        if isinstance(v, date):
            return True, v
        try:
            reg = r'^([0-9]{4})(?:-(0[1-9]|1[0-2])(?:-(0[1-9]|[1-2][0-9]|3[0-1])(?:T' \
                  r'([0-5][0-9])(?::([0-5][0-9])(?::([0-5][0-9]))?)?)?)?)?$'
            match = re.match(reg, v)
            if match:
                groups = match.groups()
                patterns = ['%Y', '%m', '%d', '%H', '%M', '%S']
                d = datetime.strptime('-'.join([x for x in groups if x]),
                                      '-'.join([patterns[i] for i in range(len(patterns)) if groups[i]]))
                return True, d
        except:
            pass
        return False, v
239991
def is_correct(self):
        
        valid = True
        valid &= self.swday in range(7)
        if not valid:
            logger.error("Error: %s is not a valid day", self.swday)

        valid &= self.ewday in range(7)
        if not valid:
            logger.error("Error: %s is not a valid day", self.ewday)

        return valid
1113120
def date_matches(self, timestamp):
        """"""
        if self.date is None:
            return False

        timestamp = datetime.fromtimestamp(float(timestamp), self.timezone)
        if self.date.date() == timestamp.date():
            return True

        return False
514816
function isValid(date) {
  return Object.prototype.toString.call(date) == '[object Date]' && !isNaN(date.getTime());
}