Here you can find the source of isRestDay(Calendar cal)
public static final boolean isRestDay(Calendar cal)
//package com.java2s; //License from project: Apache License import java.util.Calendar; import java.util.Date; public class Main { public static final boolean isRestDay(Calendar cal) { int weekDay = cal.get(Calendar.DAY_OF_WEEK); return weekDay == Calendar.SATURDAY || weekDay == Calendar.SUNDAY; }/* ww w. j a va2 s . c o m*/ public static final boolean isRestDay(Date d) { Calendar cal = Calendar.getInstance(); cal.setTime(d); int weekDay = cal.get(Calendar.DAY_OF_WEEK); return weekDay == Calendar.SATURDAY || weekDay == Calendar.SUNDAY; } }