Android Calendar Compare isUpdateTimeRecently(Calendar currentTime, Calendar updateTime)

Here you can find the source of isUpdateTimeRecently(Calendar currentTime, Calendar updateTime)

Description

is Update Time Recently

Declaration

public static boolean isUpdateTimeRecently(Calendar currentTime,
            Calendar updateTime) 

Method Source Code

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

public class Main {
    private static final int INTERVAL_MINUTE_TO_UPDATE = 30;

    public static boolean isUpdateTimeRecently(Calendar currentTime,
            Calendar updateTime) {
        for (int i = 0; i < INTERVAL_MINUTE_TO_UPDATE; i++) {
            updateTime.add(Calendar.MINUTE, 1);
        }/*ww  w . ja  v a 2  s .  c  om*/
        if (currentTime.compareTo(updateTime) == 1) {
            return false;
        }
        return true;
    }
}

Related

  1. isDateInInterval(Calendar date, int interval, TimeUnit type)
  2. isCurrentTimeInRange(Calendar now, Calendar start, Calendar end)
  3. isFiveMinutesOlder(Calendar updatedAt)
  4. isPast(String end)
  5. isOverCurrentDate(int day, int month, int year, int maxDay, int maxMonth, int maxYear)