Java Calendar Week isWeekday(Calendar cal)

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

Description

is Weekday

License

Open Source License

Declaration

private static boolean isWeekday(Calendar cal) 

Method Source Code

//package com.java2s;
/**************************************************************************************
 * Copyright (C) 2008 EsperTech, Inc. All rights reserved.                            *
 * http://esper.codehaus.org                                                          *
 * http://www.espertech.com                                                           *
 * ---------------------------------------------------------------------------------- *
 * The software in this package is published under the terms of the GPL license       *
 * a copy of which has been included with this distribution in the license.txt file.  *
 **************************************************************************************/

import java.util.Calendar;

public class Main {
    private static boolean isWeekday(Calendar cal) {
        int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);
        return !(dayOfWeek < Calendar.MONDAY || dayOfWeek > Calendar.FRIDAY);
    }/*  ww  w. j  a  v a 2 s  .c o  m*/
}

Related

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