Android Calendar Compare isPast(String end)

Here you can find the source of isPast(String end)

Description

is Past

Declaration

public static boolean isPast(String end) 

Method Source Code

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

public class Main {
    public static boolean isPast(String end) {
        String[] splitEndStr = end.split(":");
        int hrEnd = Integer.parseInt(splitEndStr[0]);
        int minEnd = Integer.parseInt(splitEndStr[1]);
        Calendar endCal = Calendar.getInstance();
        endCal.set(Calendar.HOUR_OF_DAY, hrEnd);
        endCal.set(Calendar.MINUTE, minEnd);
        Calendar currentCal = Calendar.getInstance();
        if (endCal.before(currentCal)) {
            return true;
        }/*from  w  ww .j av  a  2 s  .  c o  m*/
        return false;
    }
}

Related

  1. compare(Calendar d1, Calendar d2)
  2. getDateDelta(int delta, String dateFormat)
  3. isDateInInterval(Calendar date, int interval, TimeUnit type)
  4. isCurrentTimeInRange(Calendar now, Calendar start, Calendar end)
  5. isFiveMinutesOlder(Calendar updatedAt)
  6. isOverCurrentDate(int day, int month, int year, int maxDay, int maxMonth, int maxYear)
  7. isUpdateTimeRecently(Calendar currentTime, Calendar updateTime)