Created by HannahMitt on 8/23/15.
| 6 | * Created by HannahMitt on 8/23/15. |
| 7 | */ |
| 8 | public 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected