Compare two strings that should represent event dates (ingoring time, if not a date range)

@param eventDate to compare with second event date
@param secondEventDate to compare with
@return true if the two provided event dates represent the same interval.
974203
public static Boolean eventsAreSameInterval(String eventDate, String secondEventDate) {
		boolean result = false;
		try {
			Interval interval = null;
			Interval secondInterval = null;
            interval = DateUtils.extractDateInterval(eventDate);
            secondInterval = DateUtils.extractDateInterval(secondEventDate);
			logger.debug(interval.toString());
			logger.debug(secondInterval.toString());
            result = interval.equals(secondInterval);
		} catch (IllegalFieldValueException ex) { 
			// field format error, can't parse as date, log at debug level.
			logger.debug(ex.getMessage());
		} catch (Exception e) { 
			logger.error(e.getMessage());
		}
        return result;
	}
1120461
static long comparable(DateValue dv) {
        long comp = (((((long) dv.year()) << 4) + dv.month()) << 5) + dv.day();
        if (dv instanceof TimeValue) {
            TimeValue tv = (TimeValue) dv;
            // We add 1 to comparable for timed values to make sure that timed
            // events are distinct from all-day events, in keeping with
            // DateValue.compareTo.

            // It would be odd if an all day exclusion matched a midnight event on
            // the same day, but not one at another time of day.
            return (((((comp << 5) + tv.hour()) << 6) + tv.minute()) << 6)
                    + tv.second() + 1;
        } else {
            return comp << 17;
        }
    }
704987
public boolean validateEventName(String eventName) {
        boolean isValid = false;
        if ((AuditConstants.validEventNamesList).contains(eventName))
            isValid = true;
        return isValid;
    }
989116
private static boolean checkDate(Calendar cal, int date, int month) {
		return cal.get(Calendar.DATE) == date && cal.get(Calendar.MONTH) == month;
	}
1159853
public boolean activeOn (LocalDate date) {
        // first check for exceptions
        CalendarDate exception = calendar_dates.get(date);

        if (exception != null)
            return exception.exception_type == 1;

        else if (calendar == null)
            return false;

        else {
            int gtfsDate = date.getYear() * 10000 + date.getMonthValue() * 100 + date.getDayOfMonth();
            boolean withinValidityRange = calendar.end_date >= gtfsDate && calendar.start_date <= gtfsDate;

            if (!withinValidityRange) return false;

            switch (date.getDayOfWeek()) {
                case MONDAY:
                    return calendar.monday == 1;
                case TUESDAY:
                    return calendar.tuesday == 1;
                case WEDNESDAY:
                    return calendar.wednesday == 1;
                case THURSDAY:
                    return calendar.thursday == 1;
                case FRIDAY:
                    return calendar.friday == 1;
                case SATURDAY:
                    return calendar.saturday == 1;
                case SUNDAY:
                    return calendar.sunday == 1;
                default:
                    throw new IllegalArgumentException("unknown day of week constant!");
            }
        }
    }
851242
private void toNextDate(Calendar date, int interval) {

        long previousDate = date.getTimeInMillis();
        if (!m_weekOfMonthIterator.hasNext()) {
            date.add(Calendar.MONTH, interval);
            m_weekOfMonthIterator = m_weeksOfMonth.iterator();
        }
        toCorrectDateWithDay(date, m_weekOfMonthIterator.next());
        if (previousDate == date.getTimeInMillis()) { // this can happen if the fourth and the last week are checked.
            toNextDate(date);
        }

    }
806303
@Override
    public boolean isEqual(Object o) {
        if (o == this) {
            return true;
        }
        if (!(o instanceof Event)) {
            return false;
        }

        Event a = (Event) o;
        return super.isEqual(a);
    }
850682
public boolean insideRange(Date startDate, Date endDate) {
	Calendar c1 = Calendar.getInstance();
	Calendar c2 = Calendar.getInstance();
	c1.setTime(startDate);
	c2.setTime(endDate);
	return isInRange(c1, c2);
    }
554587
public static int compareToDDMMYYYY(String date1, String date2) {
		if(date1.length()!=8 || date2.length()!=8) return 0;
		return compareToDDMMYYYY0(date1)-compareToDDMMYYYY0(date2);
	}
624580
public static boolean isToday(Date time) {
        String now = getFormatDate(SHORT);
        String target = getFormatDate(SHORT, time);
        return now.equals(target);
    }
1263594
public static boolean isSameDay(Calendar cal1, Calendar cal2) {
		if (cal1 == null || cal2 == null) {
			throw new IllegalArgumentException("The date must not be null");
		}
		return cal1.get(Calendar.DAY_OF_YEAR) == cal2.get(Calendar.DAY_OF_YEAR) && //
				cal1.get(Calendar.YEAR) == cal2.get(Calendar.YEAR) && //
				cal1.get(Calendar.ERA) == cal2.get(Calendar.ERA);
	}
776052
private boolean eq(final Object o1, final Object o2) {

		if (o1 == null && o2 == null) {
			return true;
		}

		if ((o1 == null && o2 != null) || (o1 != null && o2 == null)) {
			return false;
		}

		try {

			if (o1 instanceof Number && o2 instanceof Number) {

				return compareNumberNumber(o1, o2) == 0;

			} else if (o1 instanceof String && o2 instanceof String) {

				return compareStringString(o1, o2) == 0;

			} else if (o1 instanceof Date && o2 instanceof Date) {

				return compareDateDate(o1, o2) == 0;

			} else if (o1 instanceof Date && o2 instanceof String) {

				return compareDateString(o1, o2) == 0;

			} else if (o1 instanceof String && o2 instanceof Date) {

				return compareStringDate(o1, o2) == 0;

			} else if (o1 instanceof Boolean && o2 instanceof String) {

				return compareBooleanString((Boolean)o1, (String)o2) == 0;

			} else if (o1 instanceof String && o2 instanceof Boolean) {

				return compareStringBoolean((String)o1, (Boolean)o2) == 0;

			} else if (o1 instanceof Number && o2 instanceof String) {

				return compareNumberString((Number)o1, (String)o2) == 0;

			} else if (o1 instanceof String && o2 instanceof Number) {

				return compareStringNumber((String)o1, (Number)o2) == 0;

			} else {

				return compareStringString(o1.toString(), o2.toString()) == 0;

			}

		} catch (NumberFormatException nfe) {

			return false;

		}
	}
152353
static boolean hasMoreApplicationEvents(List<TraceEvent> events, int index)
   {
      if (index < 0 || index >= events.size())
         return false;

      for (int j = index; j < events.size(); j++)
      {
         TraceEvent te = events.get(j);
         if (te.getType() == TraceEvent.GET_CONNECTION ||
             te.getType() == TraceEvent.RETURN_CONNECTION)
            return true;
      }

      return false;
   }
128255
public static boolean isDateInThePast(final Date date)
	{
		boolean inPast = false;
		final Calendar compare = Calendar.getInstance();
		compare.setTime(date);
		final Calendar now = Calendar.getInstance();
		now.setTime(new Date(System.currentTimeMillis()));
		inPast = now.after(compare);
		return inPast;
	}
1206179
public static boolean isPeriodActive(final Date startDate, final Date endDate) {
		if (startDate == null && endDate == null) {
			return true;
		}
		if (startDate == null) {
			throw new JKException("START_DATE_CAN_NOT_BE_NULL");
		}
		if (endDate == null) {
			throw new JKException("END_DATE_CAN_NOT_BE_NULL");
		}
		if (compareTwoDates(startDate, endDate).equals(CompareDates.DATE1_GREATER_THAN_DATE2)) {
			throw new JKException("START_DATE_MUST_BE_BEFORE_END_DATE");
		}
		final boolean startLessThanCurrent = compareTwoDates(startDate, getSystemDate()).equals(CompareDates.DATE1_LESS_THAN_DATE2);
		final boolean endGreaterThanCurrent = compareTwoDates(endDate, getSystemDate()).equals(CompareDates.DATE1_GREATER_THAN_DATE2);
		return startLessThanCurrent && endGreaterThanCurrent;
	}
908824
public static int countLeapDays(String eventDate) {
		int result = 0;
		if (!DateUtils.isEmpty(eventDate) && DateUtils.eventDateValid(eventDate)) {
			Interval interval = extractInterval(eventDate);
			Integer sYear = interval.getStart().getYear();
			Integer eYear = interval.getEnd().getYear();
			String startYear = Integer.toString(sYear).trim();
			String endYear = Integer.toString(eYear).trim();
			String leapDay = startYear + "-02-29";
			logger.debug(leapDay);
			if (DateUtils.eventDateValid(leapDay)) { 
				if (interval.contains(DateUtils.extractInterval(leapDay))) { 
					result = 1;
				}
			}
			// Range spanning more than one year, check last year
			if (!endYear.equals(startYear)) { 
				leapDay = endYear + "-02-29";
				logger.debug(leapDay);
				if (DateUtils.eventDateValid(leapDay)) { 
					if (interval.contains(DateUtils.extractInterval(leapDay))) { 
						result++;
					}
				}				
			}
			// Ranges of more than two years, check intermediate years
			if (eYear > sYear + 1) { 
				for (int testYear = sYear+1; testYear<eYear; testYear++) { 
					leapDay = Integer.toString(testYear).trim() + "-02-29";
					logger.debug(leapDay);
					if (DateUtils.eventDateValid(leapDay)) { 
						if (interval.contains(DateUtils.extractInterval(leapDay))) { 
							result++;
						}
					}				
				}
			}
		}
		return result;
	}
627424
function(event) {
		var date,
			inst = $.datepicker._getInst(event.target);

		if (inst.input.val() !== inst.lastVal) {
			try {
				date = $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
					(inst.input ? inst.input.val() : null),
					$.datepicker._getFormatConfig(inst));

				if (date) { // only if valid
					$.datepicker._setDateFromField(inst);
					$.datepicker._updateAlternate(inst);
					$.datepicker._updateDatepicker(inst);
				}
			}
			catch (err) {
			}
		}
		return true;
	}