OakvilleWork OakvilleWork - 6 months ago 5x
Java Question

last day of month calculation

I am having issues with the calculation of when the next Last Day of the Month is for a notification which is scheduled to be sent.

Here is my code:

RecurrenceFrequency recurrenceFrequency = notification.getRecurrenceFrequency();
Calendar nextNotifTime = Calendar.getInstance();

This is the line causing issues I believe:


How can I use the Calendar to properly set the last day of the next month for the notification?



This returns actual maximum for current month. For example it is February of leap year now, so it returns 29.