Here you can find the source of calcNextDayOfWeekFromLDT(LocalDateTime ldt, DayOfWeek dow)
Parameter | Description |
---|---|
ldt | a parameter |
dow | a parameter |
Parameter | Description |
---|---|
Exception | an exception |
public static LocalDate calcNextDayOfWeekFromLDT(LocalDateTime ldt, DayOfWeek dow) throws Exception
//package com.java2s; //License from project: Open Source License import java.time.*; import java.time.temporal.TemporalAdjusters; public class Main { /**/*from w w w.ja v a 2 s. c om*/ * Like it says * * @param ldt * @param dow * @return * @throws Exception */ public static LocalDate calcNextDayOfWeekFromLDT(LocalDateTime ldt, DayOfWeek dow) throws Exception { LocalDate d = ldt.toLocalDate(); return calcNextDayOfWeek(d, dow); } /** * Find the next day of the week from the given LocalDate * * @param d * @param dow * @return */ public static LocalDate calcNextDayOfWeek(LocalDate d, DayOfWeek dow) throws Exception { return d.with(TemporalAdjusters.next(dow)); } }