List of utility methods to do Day of
boolean | isDiffIsBiggerThanMin(Date lastLogIn, Date now, Long daysL) is Diff Is Bigger Than Min long diffinDays = diffInDays(lastLogIn, now); Boolean resultValue = diffinDays > daysL; return resultValue; |
boolean | isEndOfDay(GregorianCalendar cal1) is End Of Day return guiTimeFormat(cal1).equals(END_OF_DAY);
|
boolean | isHoliday(Date date, String[] excludes, String[] includes) is Holiday SimpleDateFormat simpleDateFormat = new SimpleDateFormat("MMdd"); if (date == null) { date = new Date(); Calendar calendar = Calendar.getInstance(); calendar.setTime(date); int week = calendar.get(Calendar.DAY_OF_WEEK); String today = simpleDateFormat.format(calendar.getTime()); ... |
boolean | isIn(int reserveDayCount, String dateString) is In Date date = date(dateString); int interval = interval(date, new Date()); if (interval < 0) { return reserveDayCount > Math.abs(interval); return false; |
boolean | isInAllDayFormat(String date) Check if the date is into format yyyyMMdd or yyyy-MM-dd. String pattern = getDateFormat(date); if (pattern == null) { return false; if (pattern.equals(PATTERN_YYYYMMDD) || pattern.equals(PATTERN_YYYY_MM_DD)) { return true; return false; ... |
boolean | isNowDay(String d) is Now Day boolean flg = false; SimpleDateFormat sd = new SimpleDateFormat(DATE_FORMAT); String nowDate = sd.format(new Date()); try { d = sd.format(sd.parse(d)); if (d.equals(nowDate)) { flg = true; } catch (ParseException e) { e.printStackTrace(); return flg; |
Boolean | isSomeDay(String date) is Some Day String today = date2Str(new Date(), "yyyy-MM-dd"); return date.equals(today); |
List | lastDays(int count) last Days List<String> strings = new ArrayList<String>(); Calendar day = Calendar.getInstance(); for (int i = 0; i < count; i++) { day.add(Calendar.DATE, -1); strings.add(df.format(day.getTime())); return strings; |
String | long2StringPerDay(long t, SimpleDateFormat sdf) long String Per Day return sdf.format(new Date(t)); |
long | minDayToLong(String time) min Day To Long return new SimpleDateFormat("yyyy-MM-ddZ").parse(time).getTime(); |