Example usage for java.time.temporal TemporalAdjusters previousOrSame

List of usage examples for java.time.temporal TemporalAdjusters previousOrSame

Introduction

In this page you can find the example usage for java.time.temporal TemporalAdjusters previousOrSame.

Prototype

public static TemporalAdjuster previousOrSame(DayOfWeek dayOfWeek) 

Source Link

Document

Returns the previous-or-same day-of-week adjuster, which adjusts the date to the first occurrence of the specified day-of-week before the date being adjusted unless it is already on that day in which case the same object is returned.

Usage

From source file:Main.java

public static void main(String[] args) {
    LocalDate d = LocalDate.now().with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY));
    System.out.println(d);//w  w w.  ja v a 2  s  .c om

}