@Test public void getPreviousMonday() { }
public static Date getPreviousMonday() { Calendar cd = Calendar.getInstance(); int dayOfWeek = cd.get(Calendar.DAY_OF_WEEK) - 1; Date date; if (dayOfWeek == 1) { date = addDays(cd.getTime(), -7); } else { date = addDays(cd.getTime(), -6 - dayOfWeek); } return getStartOfDate(date); }
DateUtil { public static Date getPreviousMonday() { Calendar cd = Calendar.getInstance(); int dayOfWeek = cd.get(Calendar.DAY_OF_WEEK) - 1; Date date; if (dayOfWeek == 1) { date = addDays(cd.getTime(), -7); } else { date = addDays(cd.getTime(), -6 - dayOfWeek); } return getStartOfDate(date); } }
DateUtil { public static Date getPreviousMonday() { Calendar cd = Calendar.getInstance(); int dayOfWeek = cd.get(Calendar.DAY_OF_WEEK) - 1; Date date; if (dayOfWeek == 1) { date = addDays(cd.getTime(), -7); } else { date = addDays(cd.getTime(), -6 - dayOfWeek); } return getStartOfDate(date); }  }
DateUtil { public static Date getPreviousMonday() { Calendar cd = Calendar.getInstance(); int dayOfWeek = cd.get(Calendar.DAY_OF_WEEK) - 1; Date date; if (dayOfWeek == 1) { date = addDays(cd.getTime(), -7); } else { date = addDays(cd.getTime(), -6 - dayOfWeek); } return getStartOfDate(date); }  static Calendar getCurrentCalendar(); static Timestamp getCurrentTimestamp(); static Date getCurrentDatetime(); static Date getCurrentDate(); static String getYear(); static String getMonth(); static String getDay(); static final int getYear(Date date); static final int getYear(long millis); static final int getMonth(Date date); static final int getMonth(long millis); static final int getDay(Date date); static final int getDay(long millis); static final int getHour(Date date); static final int getHour(long millis); static String getChinesePatternNow(); static String getFullChinesePatternNow(); static String getChinesePatternNow(Date date); static String getFullCNPatternNow(Date date); static String formatDate(final Date date); static String formatDate(final Date date, String format); static String formatDate(String format); static Date parseDate(String sDate); static Date parseDate(String sDate, String format); static Date parseDate(String sDate, String format, Date defaultValue); static Date addMonths(Date date, int months); static Date addDays(final Date date, int days); static Date addMins(final Date date, int mins); static int compareDate(Date first, Date second); static Date getSmaller(Date first, Date second); static Date getLarger(Date first, Date second); static boolean isDateBetween(Date date, Date begin, Date end); static boolean isSameMonth(Date date1, Date date2); static boolean isSameDay(Date date1, Date date2); static boolean isSameMonth(Calendar cal1, Calendar cal2); static Date getStartOfDate(final Date date); static Date getPreviousMonday(); static Date getMondayBefore4Week(); static Date getCurrentMonday(); static Date getEndOfMonth(final Date date); static Date getFirstOfMonth(final Date date); static Date getWeekBegin(Date date); static Date getWeekEnd(Date date); static boolean inFormat(String sourceDate, String format); static int getNumberOfSecondsBetween(final double d1, final double d2); static int getNumberOfMonthsBetween(final Date begin, final Date end); static long getNumberOfMinuteBetween(final Date begin, final Date end); static long getNumberOfHoursBetween(final Date begin, final Date end); static long getNumberOfDaysBetween(final Date begin, final Date end); static long getNumberOfDaysBetween(Calendar before, Calendar after); static Date getRemoteDate(String url); static Calendar getCurDateCeil(); static Calendar getCurDateFloor(); static Date getWeekBegin(Calendar tmp); static Date getWeekEnd(Calendar tmp); static Date getQuarterBegin(Calendar tmp); static Date getQuarterEnd(Calendar tmp); static Date getQuarterBegin(Date date); static Date getQuarterEnd(Date date); static Date getYearBegin(final Date date); static Date getYearEnd(final Date date); static void main(String[] args); static Date getDate(int year, int month, int day); }
DateUtil { public static Date getPreviousMonday() { Calendar cd = Calendar.getInstance(); int dayOfWeek = cd.get(Calendar.DAY_OF_WEEK) - 1; Date date; if (dayOfWeek == 1) { date = addDays(cd.getTime(), -7); } else { date = addDays(cd.getTime(), -6 - dayOfWeek); } return getStartOfDate(date); }  static Calendar getCurrentCalendar(); static Timestamp getCurrentTimestamp(); static Date getCurrentDatetime(); static Date getCurrentDate(); static String getYear(); static String getMonth(); static String getDay(); static final int getYear(Date date); static final int getYear(long millis); static final int getMonth(Date date); static final int getMonth(long millis); static final int getDay(Date date); static final int getDay(long millis); static final int getHour(Date date); static final int getHour(long millis); static String getChinesePatternNow(); static String getFullChinesePatternNow(); static String getChinesePatternNow(Date date); static String getFullCNPatternNow(Date date); static String formatDate(final Date date); static String formatDate(final Date date, String format); static String formatDate(String format); static Date parseDate(String sDate); static Date parseDate(String sDate, String format); static Date parseDate(String sDate, String format, Date defaultValue); static Date addMonths(Date date, int months); static Date addDays(final Date date, int days); static Date addMins(final Date date, int mins); static int compareDate(Date first, Date second); static Date getSmaller(Date first, Date second); static Date getLarger(Date first, Date second); static boolean isDateBetween(Date date, Date begin, Date end); static boolean isSameMonth(Date date1, Date date2); static boolean isSameDay(Date date1, Date date2); static boolean isSameMonth(Calendar cal1, Calendar cal2); static Date getStartOfDate(final Date date); static Date getPreviousMonday(); static Date getMondayBefore4Week(); static Date getCurrentMonday(); static Date getEndOfMonth(final Date date); static Date getFirstOfMonth(final Date date); static Date getWeekBegin(Date date); static Date getWeekEnd(Date date); static boolean inFormat(String sourceDate, String format); static int getNumberOfSecondsBetween(final double d1, final double d2); static int getNumberOfMonthsBetween(final Date begin, final Date end); static long getNumberOfMinuteBetween(final Date begin, final Date end); static long getNumberOfHoursBetween(final Date begin, final Date end); static long getNumberOfDaysBetween(final Date begin, final Date end); static long getNumberOfDaysBetween(Calendar before, Calendar after); static Date getRemoteDate(String url); static Calendar getCurDateCeil(); static Calendar getCurDateFloor(); static Date getWeekBegin(Calendar tmp); static Date getWeekEnd(Calendar tmp); static Date getQuarterBegin(Calendar tmp); static Date getQuarterEnd(Calendar tmp); static Date getQuarterBegin(Date date); static Date getQuarterEnd(Date date); static Date getYearBegin(final Date date); static Date getYearEnd(final Date date); static void main(String[] args); static Date getDate(int year, int month, int day); static final long SECOND; static final long MINUTE; static final long HOUR; static final long DAY; static final String TIME_BEGIN; static final String TIME_END; static final String MONTH_PATTERN; static final String DEFAULT_PATTERN; static final String DOT_PATTERN; static final String FULL_PATTERN; static final String FULL_STANDARD_PATTERN; static final String CHINESE_PATTERN; static final String FULL_CHINESE_PATTERN; }