List of utility methods to do Week Compare
boolean | isSameWeek(Time t1, Time t2) is Same Week if (isSameDate(t1, t2)) { return true; final Time x; final Time y; if (t1.before(t2)) { x = t1; y = t2; ... |
boolean | isWithinTheWeek(Date sunday, Date now) is Within The Week long sun = sunday.getTime(); long today = now.getTime(); if (today >= sun && today <= sun + WEEK_IN_MILLISECONDS) { return true; return false; |
boolean | isSameWeek(Date date) is Same Week Calendar beginningOfTheWeek = Calendar.getInstance(); beginningOfTheWeek.set(Calendar.DAY_OF_WEEK, beginningOfTheWeek.getFirstDayOfWeek()); beginningOfTheWeek.set(Calendar.HOUR, 0); beginningOfTheWeek.set(Calendar.MINUTE, 0); Calendar endOfTheWeek = Calendar.getInstance(); endOfTheWeek.set(Calendar.DAY_OF_WEEK, endOfTheWeek.getFirstDayOfWeek()); ... |