List of utility methods to do Date Value Check
boolean | isValidDateInternal(String date, String dateFormat) is Valid Date Internal try { DateFormat df = new SimpleDateFormat(dateFormat); df.setLenient(false); df.parse(date); return true; } catch (ParseException e) { return false; |
boolean | isValidDatePattern(String pattern) is Valid Date Pattern return isValidDatePattern(pattern, null);
|
boolean | isValidDatePatterns(String dateStr, String patterns) is Valid Date Patterns if (patterns == null || "".equalsIgnoreCase(patterns) || patterns.length() < 1) { patterns = "yyyy-MM-dd;dd/MM/yyyy;yyyy/MM/dd;yyyy/M/d h:mm"; boolean isValid = false; String[] patternArr = patterns.split(";"); for (int i = 0; i < patternArr.length; i++) { try { SimpleDateFormat sdf = new SimpleDateFormat(patternArr[i]); ... |
boolean | isValidDateStr(String date, String format) is Valid Date Str try { if (date.length() != format.length()) { return false; SimpleDateFormat sdf = new SimpleDateFormat(format); sdf.setLenient(false); sdf.parse(date); } catch (Exception e) { ... |
boolean | isValidGameDate(String gameDate) is Valid Game Date try { parseDate(gameDate); } catch (ParseException e) { return false; return true; |
boolean | isValidLongDateFormat(String strDate) is Valid Long Date Format if (strDate.length() != longFormat.length()) { return false; DateFormat df = createNewDateFormat(longFormat); try { df.parse(strDate); } catch (ParseException e) { return false; ... |
boolean | isValidObjectModelDate(String aDate) is Valid Object Model Date if (aDate == null) { return true; if (aDate.equals("")) { return true; SimpleDateFormat myFormatter = new SimpleDateFormat("yyyy-MM-dd"); if (aDate.length() != 10) { ... |
Boolean | isValidPattern(String dateString, String pattern) is Valid Pattern return parse(dateString, pattern) != null;
|