Java Day of Week isWeekEnd(Date date)

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

Description

is Week End

License

Apache License

Declaration

private static boolean isWeekEnd(Date date) 

Method Source Code

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

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

public class Main {

    private static boolean isWeekEnd(Date date) {
        Calendar cal = Calendar.getInstance();
        cal.setTime(date);//from   ww  w. j  av  a 2s .  c o m
        if (cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY || cal.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY)
            return true;
        else
            return false;
    }
}

Related

  1. isMatchWeek(Date date, int week)
  2. isOnWeekend(Date date)
  3. isSameWeekDates(Date date1, Date date2)
  4. isWeekday(Date startDate)
  5. isWeekDay(final Date date)
  6. isWeekend(Date date)
  7. isWeekend(Date date)
  8. isWeekend(Date date)
  9. isWeekend(Date date)