Java LocalDate Calculate isDayOfWeek(LocalDate d, DayOfWeek dow)

Here you can find the source of isDayOfWeek(LocalDate d, DayOfWeek dow)

Description

Check the LocalDate given to see if it is the DayOfWeek given

License

Open Source License

Parameter

Parameter Description
d a parameter
dow a parameter

Declaration

public static boolean isDayOfWeek(LocalDate d, DayOfWeek dow) throws Exception 

Method Source Code


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

import java.time.*;

public class Main {
    /**/* ww w  .j  a  v  a 2  s  .c  o m*/
     * Check the LocalDate given to see if it is the DayOfWeek given
     *
     * @param d
     * @param dow
     */
    public static boolean isDayOfWeek(LocalDate d, DayOfWeek dow) throws Exception {
        if (d.getDayOfWeek().compareTo(dow) == 0) {
            return true;
        } else {
            return false;
        }
    }
}

Related

  1. getWeekOfTheYear(final LocalDate dateOfYear)
  2. getYearMonth(LocalDate localDate)
  3. isActual(LocalDate before, LocalDate after)
  4. isAnyLocalDate(Object obj)
  5. isBankHoliday(List bankHolidays, LocalDate date)
  6. isEqual(LocalDate date1, LocalDate date2)
  7. isInPeriod(LocalDate subject, LocalDate start, LocalDate end)
  8. isLess(@Nonnull final LocalDate aDate1, @Nonnull final LocalDate aDate2)
  9. isLocalDateAD(LocalDate date)