Java Calendar Week isWeekend(Calendar cal)

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

Description

Gets the weekend attribute of the DateUtils class

License

Open Source License

Parameter

Parameter Description
cal Description of the Parameter

Return

The weekend value

Declaration

public static boolean isWeekend(Calendar cal) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Calendar;

public class Main {
    /**//from  www  .  j  av a 2s .com
     *  Gets the weekend attribute of the DateUtils class
     *
     * @param  cal  Description of the Parameter
     * @return      The weekend value
     */
    public static boolean isWeekend(Calendar cal) {
        return (cal.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY
                || cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY);
    }
}

Related

  1. getWeekOfCurrentDayWithoutStartShift(Calendar cal)
  2. getWeekStart(boolean startSunday, Calendar date)
  3. isThisWeek(Calendar time)
  4. isWeekday(Calendar cal)
  5. isWeekEnd(Calendar c)
  6. isWeekend(GregorianCalendar date)
  7. lastDayOfWeek(Calendar cal)
  8. lastDayOfWeek(Calendar calendar)
  9. setStartOfWeek(Calendar date)