Java Day of Work isWorkday(Date date)

Here you can find the source of isWorkday(Date date)

Description

is Workday

License

Apache License

Declaration

public static boolean isWorkday(Date date) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Calendar;
import java.util.Date;

public class Main {

    public static boolean isWorkday(Date date) {
        Calendar cal = Calendar.getInstance();
        if (date != null) {
            cal.setTime(date);/*  w  w w .  j  a v a  2  s . co m*/
        }
        int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);
        return !(dayOfWeek == Calendar.SATURDAY || dayOfWeek == Calendar.SUNDAY);
    }
}

Related

  1. addWorkingDays(Date start, int workingDays)
  2. getRemainingWorkingMonth(Date taxdate)
  3. getWorkDay(Date d1, Date d2, int[] freeDays)
  4. isWorkDay(Date data)
  5. isWorkDay(Date date)
  6. isWorking(final Date date)