Java examples for java.time:Week
Calculates which date the given weekday occurs next time.
//package com.java2s; import java.time.*; import java.time.temporal.TemporalAdjusters; public class Main { /**// w w w . jav a 2 s . com * Calculates which date the given weekday occurs next time. * * @param day The weekday to find. * @return The next occurrence of the weekday. */ public static LocalDate getNextDateOfDay(DayOfWeek day) { return LocalDate.now().with(TemporalAdjusters.next(day)); } }