Get Monday of last week with JodaTime

164 Views Asked by At

I need get Monday of last week E.g

Today is 28/11/18 (wednesday)

I need get 19/11/18 (monday)

I know that I can obtain Monday of the current week with

val monday = DateTime().withDayOfWeek(DateTimeConstants.MONDAY)
1

There are 1 best solutions below

0
On BEST ANSWER

I get it!

DateTime().withWeekOfWeekyear(
                 DateTime().weekOfWeekyear-1)
          .withDayOfWeek(DateTimeConstants.MONDAY)

I only have to get the week of the year and subtract one week and that is all