is LocalDate Weekend - Java java.time

Java examples for java.time:Week

Description

is LocalDate Weekend

Demo Code


//package com.java2s;
import java.time.DayOfWeek;
import java.time.LocalDate;

public class Main {
    public static boolean isWeekend(LocalDate localDate) {
        DayOfWeek day = localDate.getDayOfWeek();
        return (day.equals(DayOfWeek.SATURDAY) || day
                .equals(DayOfWeek.SUNDAY));
    }/*  www .  j a va  2  s . c o m*/
}

Related Tutorials