MCPcopy Create free account
hub / github.com/HannahMitt/HomeMirror / WeekUtil

Class WeekUtil

app/src/main/java/com/morristaedt/mirror/utils/WeekUtil.java:8–27  ·  view source on GitHub ↗

Created by HannahMitt on 8/23/15.

Source from the content-addressed store, hash-verified

6 * Created by HannahMitt on 8/23/15.
7 */
8public class WeekUtil {
9
10 public static boolean isWeekday() {
11 int dayOfWeek = Calendar.getInstance().get(Calendar.DAY_OF_WEEK);
12 return dayOfWeek != Calendar.SATURDAY && dayOfWeek != Calendar.SUNDAY;
13 }
14
15 public static boolean afterFive() {
16 int hourOfDay = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
17 return hourOfDay >= 17;
18 }
19
20 public static boolean isWeekdayBeforeFive() {
21 return isWeekday() && !afterFive();
22 }
23
24 public static boolean isWeekdayAfterFive() {
25 return isWeekday() && afterFive();
26 }
27}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected