Android Long to Week Convert isBeyondNextWeek(long lTime)

Here you can find the source of isBeyondNextWeek(long lTime)

Description

is Beyond Next Week

Declaration

public static boolean isBeyondNextWeek(long lTime) 

Method Source Code

//package com.java2s;
import java.util.Calendar;

public class Main {
    public static boolean isBeyondNextWeek(long lTime) {
        Calendar calToday = Calendar.getInstance();
        Calendar calUnknown = Calendar.getInstance();
        calToday.setTimeInMillis(System.currentTimeMillis());
        calUnknown.setTimeInMillis(lTime);
        int nDayOfWeek = calToday.get(Calendar.DAY_OF_WEEK);
        if (nDayOfWeek == Calendar.SUNDAY) {
            nDayOfWeek = Calendar.SATURDAY + 1;
        }//  w  ww  .jav  a  2  s  .com
        nDayOfWeek -= 1;
        calToday.add(Calendar.DAY_OF_YEAR, 8 - nDayOfWeek);
        if (calUnknown.before(calToday)) {
            return false;
        }
        calToday.add(Calendar.DAY_OF_YEAR, 7);
        if (calUnknown.after(calToday)) {
            return true;
        }
        return false;
    }
}

Related

  1. isInNextWeek(long lTime)
  2. isInLastWeek(long lTime)
  3. isInCurrentWeek(long lTime)
  4. addWeek(long dateTimeMillis)
  5. addWeek(long dateTimeMillis)