![JAR search and dependency download from the Maven repository](/logo.png)
nl.hsac.fitnesse.symbols.LastDayOfMonth Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hsac-fitnesse-plugin Show documentation
Show all versions of hsac-fitnesse-plugin Show documentation
Plugin to add features to a FitNesse installation
The newest version!
package nl.hsac.fitnesse.symbols;
import java.util.Calendar;
import java.util.GregorianCalendar;
/**
* Variation on !today, allowing last day of a month to be selected.
*/
public class LastDayOfMonth extends MonthsFromToday {
public LastDayOfMonth() {
super("LastDayOfMonth", "!lastDayOfMonth");
}
@Override
protected void addIncrement(GregorianCalendar cal, int increment) {
// go to first day of month
cal.set(Calendar.DATE, 1);
// add 1 more month than requested, to go to end of this
super.addIncrement(cal, increment + 1);
// subtract 1 to go to last of month before
cal.add(Calendar.DATE, -1);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy