Java Day of Work isWorking(final Date date)

Here you can find the source of isWorking(final Date date)

Description

is Working

License

Open Source License

Declaration

public static boolean isWorking(final Date date) 

Method Source Code

//package com.java2s;

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

public class Main {

    public static boolean isWorking(final Date date) {
        final int hourOfDay = getHourOfDay(date);
        if (hourOfDay > 8 && hourOfDay < 19) {
            return true;
        }// w w  w  .  ja v a  2s  . c om
        return false;
    }

    public static int getHourOfDay(final Date oDate) {
        if (null == oDate) {
            return -1;
        }

        final Calendar cal = Calendar.getInstance();
        cal.setTime(oDate);

        return cal.get(Calendar.HOUR_OF_DAY);
    }
}

Related

  1. getRemainingWorkingMonth(Date taxdate)
  2. getWorkDay(Date d1, Date d2, int[] freeDays)
  3. isWorkDay(Date data)
  4. isWorkDay(Date date)
  5. isWorkday(Date date)