Java Calendar Day isDayAfter(Calendar calendar, Calendar baseCalendar)

Here you can find the source of isDayAfter(Calendar calendar, Calendar baseCalendar)

Description

is Day After

License

Open Source License

Declaration

public static boolean isDayAfter(Calendar calendar, Calendar baseCalendar) 

Method Source Code


//package com.java2s;

import java.util.Calendar;

public class Main {
    public static boolean isDayAfter(Calendar calendar, Calendar baseCalendar) {
        if (calendar.get(Calendar.YEAR) > baseCalendar.get(Calendar.YEAR)) {
            return true;
        } else if (calendar.get(Calendar.YEAR) < baseCalendar.get(Calendar.YEAR)) {
            return false;
        }//w  w  w.j a v  a 2s  .co m

        if (calendar.get(Calendar.MONTH) > baseCalendar.get(Calendar.MONTH)) {
            return true;
        } else if (calendar.get(Calendar.MONTH) < baseCalendar.get(Calendar.MONTH)) {
            return false;
        }

        if (calendar.get(Calendar.DATE) > baseCalendar.get(Calendar.DATE)) {
            return true;
        }
        return false;
    }
}

Related

  1. incrementDay(Calendar cal)
  2. incrementOneDay(Calendar calendar)
  3. isAfterDay(Calendar cal1, Calendar cal2)
  4. isAllDayEvent(Calendar dtStart, Calendar dtEnd)
  5. isBusinessDay(Calendar cal)
  6. isDSTChangeDay(Calendar cal)
  7. isEndOfDay(Calendar calendar)
  8. isHolyday(Calendar c)
  9. isRestDay(Calendar cal)