Java Calendar Day isRestDay(Calendar cal)

Here you can find the source of isRestDay(Calendar cal)

Description

is Rest Day

License

Apache License

Declaration

public static final boolean isRestDay(Calendar cal) 

Method Source Code

//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;
    }
}

Related

  1. isBusinessDay(Calendar cal)
  2. isDayAfter(Calendar calendar, Calendar baseCalendar)
  3. isDSTChangeDay(Calendar cal)
  4. isEndOfDay(Calendar calendar)
  5. isHolyday(Calendar c)
  6. isSameDay(Calendar c1, Calendar c2)
  7. isSameDay(Calendar cal1, Calendar cal2)
  8. isSameDay(Calendar cal1, Calendar cal2)
  9. isSameDay(Calendar cal1, Calendar cal2)