Java Day End isCalenderDaySame(GregorianCalendar aInCal1, GregorianCalendar aInCal2)

Here you can find the source of isCalenderDaySame(GregorianCalendar aInCal1, GregorianCalendar aInCal2)

Description

is Calender Day Same

License

Open Source License

Declaration

public static boolean isCalenderDaySame(GregorianCalendar aInCal1, GregorianCalendar aInCal2) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    public static boolean isCalenderDaySame(GregorianCalendar aInCal1, GregorianCalendar aInCal2) {
        if ((aInCal1 == null) && (aInCal2 != null)) {
            return false;
        }/*from w w w  .ja  v a 2s.c  o  m*/

        if ((aInCal2 == null) && (aInCal1 != null)) {
            return false;
        }

        if ((aInCal2 == null) && (aInCal1 == null)) {
            return true;
        }

        if (aInCal1.get(Calendar.DAY_OF_MONTH) != aInCal2.get(Calendar.DAY_OF_MONTH)) {
            return false;
        }

        if (aInCal1.get(Calendar.MONTH) != aInCal2.get(Calendar.MONTH)) {
            return false;
        }

        if (aInCal1.get(Calendar.YEAR) != aInCal2.get(Calendar.YEAR)) {
            return false;
        }

        return true;
    }
}

Related

  1. getWorkingDaysBetweenTwoDates(Date startDate, Date endDate)
  2. getYearsBetween(Date startDate, Date endDate)
  3. getYearsBetweenDate(Date begin, Date end)
  4. isBetweenDate(Date date, Date startDate, Date endDate)
  5. isBetWeenDates(Date in, Date from, Date to)
  6. isEndOfMonth(Date d)
  7. isEndOfMonth(Date date)
  8. isEndOfMonth(Date nowday)
  9. isEndOfSeason(Date date)