urbanairship-core/src/main/java/com/urbanairship/push/QuietTimeInterval.java
boolean isInQuietTime(Calendar now) {
        Calendar start = Calendar.getInstance();
        start.set(Calendar.HOUR_OF_DAY, startHour);
        start.set(Calendar.MINUTE, startMin);
        start.set(Calendar.SECOND, 0);
        start.set(Calendar.MILLISECOND, 0);

        Calendar end = Calendar.getInstance();
        end.set(Calendar.HOUR_OF_DAY, endHour);
        end.set(Calendar.MINUTE, endMin);
        end.set(Calendar.SECOND, 0);
        end.set(Calendar.MILLISECOND, 0);

        now = (Calendar) now.clone();
        now.set(Calendar.SECOND, 0);
        now.set(Calendar.MILLISECOND, 0);

        // Equal to either start or end
        if (now.compareTo(start) == 0 || now.compareTo(end) == 0) {
            return true;
        }

        // End is equal to start but now is not equal to either end or start
        if (end.compareTo(start) == 0) {
            return false;
        }

        // End is after start
        if (end.after(start)) {
            return now.after(start) && now.before(end);
        }

        // End is before start
        return now.before(end) || now.after(start);
    }
/**
     * Determines whether we are currently in the middle of "Quiet Time".  Returns false if Quiet Time is disabled,
     * and evaluates whether or not the current date/time falls within the Quiet Time interval set by the user.
     *
     * @param now Reference time for determining if interval is in quiet time.
     * @return A boolean indicating whether it is currently "Quiet Time".
     */
Determines whether we are currently in the middle of "Quiet Time".  Returns false if Quiet Time is disabled,
and evaluates whether or not the current date/time falls within the Quiet Time interval set by the user.

@param now Reference time for determining if interval is in quiet time.
@return A boolean indicating whether it is currently "Quiet Time".
Determines whether we are currently in the middle of " Quiet Time " . Returns false if Quiet Time is disabled and evaluates whether or not the current date / time falls within the Quiet Time interval set by the user . @param now Reference time for determining if interval is in quiet time . @return A boolean indicating whether it is currently " Quiet Time " .
boolean isInQuietTime(Calendar now) {
        Calendar start = Calendar.getInstance();
        start.set(Calendar.HOUR_OF_DAY, startHour);
        start.set(Calendar.MINUTE, startMin);
        start.set(Calendar.SECOND, 0);
        start.set(Calendar.MILLISECOND, 0);
        Calendar end = Calendar.getInstance();
        end.set(Calendar.HOUR_OF_DAY, endHour);
        end.set(Calendar.MINUTE, endMin);
        end.set(Calendar.SECOND, 0);
        end.set(Calendar.MILLISECOND, 0);
        now = (Calendar) now.clone();
        now.set(Calendar.SECOND, 0);
        now.set(Calendar.MILLISECOND, 0);
        if (now.compareTo(start) == 0 || now.compareTo(end) == 0) {
            return true;
        }
        if (end.compareTo(start) == 0) {
            return false;
        }
        if (end.after(start)) {
            return now.after(start) && now.before(end);
        }
        return now.before(end) || now.after(start);
    }
boolean isInQuietTime ( Calendar now ) { Calendar start = Calendar . getInstance ( ) ; start . set ( Calendar . HOUR_OF_DAY , startHour ) ; start . set ( Calendar . MINUTE , startMin ) ; start . set ( Calendar . SECOND , 0 ) ; start . set ( Calendar . MILLISECOND , 0 ) ; Calendar end = Calendar . getInstance ( ) ; end . set ( Calendar . HOUR_OF_DAY , endHour ) ; end . set ( Calendar . MINUTE , endMin ) ; end . set ( Calendar . SECOND , 0 ) ; end . set ( Calendar . MILLISECOND , 0 ) ; now = ( Calendar ) now . clone ( ) ; now . set ( Calendar . SECOND , 0 ) ; now . set ( Calendar . MILLISECOND , 0 ) ; if ( now . compareTo ( start ) == 0 || now . compareTo ( end ) == 0 ) { return true ; } if ( end . compareTo ( start ) == 0 ) { return false ; } if ( end . after ( start ) ) { return now . after ( start ) && now . before ( end ) ; } return now . before ( end ) || now . after ( start ) ; }
Determines whether we are currently in the middle of "Quiet Time".
Determines whether we are currently in the middle of " Quiet Time " .
// Equal to either start or end // End is equal to start but now is not equal to either end or start // End is after start // End is before start