Here you can find the source of isWeekDay(final Date date)
Parameter | Description |
---|---|
date | Date |
public static boolean isWeekDay(final Date date)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { /**//from w ww . j av a 2 s. com * Figure out whether a Date is a week day. * @param date Date * @return boolean */ public static boolean isWeekDay(final Date date) { if (null == date) { return false; } Calendar cal = Calendar.getInstance(); cal.setTime(date); if (cal.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY || cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) { return false; } return true; } }