Here you can find the source of isWeekday(Date startDate)
Parameter | Description |
---|---|
startDate | a parameter |
public static boolean isWeekday(Date startDate)
//package com.java2s; //License from project: Open Source License import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar; public class Main { /**// w ww . ja va 2 s .c o m * decides if a day is Mon through Fri * @param startDate * @return true if weekday, else false */ public static boolean isWeekday(Date startDate) { GregorianCalendar cal = new GregorianCalendar(); cal.setTime(startDate); if (cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY || cal.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY) return false; return true; } }