I have a LocalDate which needs to get the first and last day of the month. How do I do that?
eg. 13/2/2014
I need to get 1/2/2014 and
YearMonthFor completeness, and more elegant in my opinion, see this use of YearMonth class.
YearMonth month = YearMonth.from(date);
LocalDate start = month.atDay(1);
LocalDate end = month.atEndOfMonth();
For the first & last day of the current month, this becomes:
LocalDate start = YearMonth.now().atDay(1);
LocalDate end = YearMonth.now().atEndOfMonth();