private int getLastDayOfMonth ( YearMonth yearMonth ) { LocalDate firstDayOfMonth = LocalDate . of ( yearMonth . getYear ( ) , yearMonth . getMonth ( ) , 1 ) ; int lastDayOfMonth = firstDayOfMonth . lengthOfMonth ( ) ; return lastDayOfMonth ; }
getLastDayOfMonth This returns the last day of the month for the specified year and month .