Here you can find the source of isEquals(Calendar startTime, Calendar timeCurrent, int type)
public static boolean isEquals(Calendar startTime, Calendar timeCurrent, int type)
//package com.java2s; //License from project: LGPL import java.util.Calendar; public class Main { public static boolean isEquals(Calendar startTime, Calendar timeCurrent, int type) { if (startTime == null || timeCurrent == null) { return false; }/*from w w w.j a v a 2 s. co m*/ if (startTime.get(Calendar.YEAR) == timeCurrent.get(Calendar.YEAR)) { if (type == Calendar.YEAR) { return true; } if (startTime.get(Calendar.WEEK_OF_YEAR) == timeCurrent.get(Calendar.WEEK_OF_YEAR)) { if (type == Calendar.WEEK_OF_YEAR) { return true; } } if (startTime.get(Calendar.MONTH) == timeCurrent.get(Calendar.MONTH)) { if (type == Calendar.MONTH) { return true; } if (startTime.get(Calendar.DAY_OF_MONTH) == timeCurrent.get(Calendar.DAY_OF_MONTH)) { if (type == Calendar.DAY_OF_MONTH) { return true; } if (startTime.get(Calendar.HOUR_OF_DAY) == timeCurrent.get(Calendar.HOUR_OF_DAY)) { if (type == Calendar.HOUR_OF_DAY) { return true; } } } } } return false; } }