Android Day Get isBirthday(Calendar cal)

Here you can find the source of isBirthday(Calendar cal)

Description

is Birthday

License

Open Source License

Declaration

public static boolean isBirthday(Calendar cal) 

Method Source Code

//package com.java2s;
/*//w ww .  j av  a 2 s.com
 *  This file is part of SWADroid.
 *
 *  Copyright (C) 2010 Juan Miguel Boyero Corral <juanmi1982@gmail.com>
 *
 *  SWADroid is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  SWADroid is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with SWADroid.  If not, see <http://www.gnu.org/licenses/>.
 */

import java.util.Calendar;

public class Main {
    public static boolean isBirthday(Calendar cal) {
        Calendar sysdate = Calendar.getInstance();

        return ((cal != null)
                && (sysdate.get(Calendar.DAY_OF_MONTH) == cal
                        .get(Calendar.DAY_OF_MONTH)) && (sysdate
                    .get(Calendar.MONTH) == cal.get(Calendar.MONTH)));
    }
}

Related

  1. getNextDay(Date d2)
  2. getNextDateForDay(int calendarDay)
  3. getHashByDay(String date)
  4. getJulianDay(Calendar cal)
  5. getIntervalDays(String sd, String ed)
  6. getBeforeDate(Date date, int days)
  7. getAfterDate(Date date, int days)
  8. fromJulianDay(double julianDay)
  9. getTimeNextDay(long lTimeMillis)