Here you can find the source of isFirstMorning(Calendar time, Calendar previous)
Parameter | Description |
---|---|
time | the current time |
previous | the previous time |
public static boolean isFirstMorning(Calendar time, Calendar previous)
//package com.java2s; //License from project: Apache License import java.util.Calendar; public class Main { /**/*www.jav a 2s.co m*/ * Tests if this will be the first good morning trigger for a message. * * @param time * the current time * @param previous * the previous time * @return true if the first time; otherwise false */ public static boolean isFirstMorning(Calendar time, Calendar previous) { if (time == null || previous == null) { return false; } if (time.get(Calendar.YEAR) == previous.get(Calendar.YEAR) && time.get(Calendar.DAY_OF_YEAR) == previous.get(Calendar.DAY_OF_YEAR) && previous.get(Calendar.HOUR_OF_DAY) >= 6) { return false; } return true; } }