Tri Nguyen Tri Nguyen - 10 months ago 42
Java Question

Java - get Monday date of a week give a date in that week

I got a date

YYYY-MM-DD
how can I get the Monday date of that date whatever the given date is?

Answer Source
LocalDate monday = 
    localDate.with(TemporalAdjusters.previousOrSame(DayOfWeek.MONDAY);