forward

fun forward(field: DateTimeUnit, amount: Int): JewishDate

Rolls the date, month or year forward by the amount passed in. It modifies both the Gregorian and Jewish dates accordingly. If manipulation beyond the fields supported here is required, use the Calendar class Calendar.add or Calendar.roll methods in the following manner.

`
Calendar cal = jewishDate.getTime(); // get a java.util.Calendar representation of the JewishDate
cal.add(Calendar.MONTH, 3); // add 3 Gregorian months
jewishDate.setDate(cal); // set the updated calendar back to this class
` *
*

Parameters

field

the calendar field to be forwarded. The must be Calendar.DATE, Calendar.MONTH or Calendar.YEAR

amount

the positive amount to move forward

See also

Calendar.add
Calendar.roll

Throws

IllegalArgumentException

if the field is anything besides Calendar.DATE, Calendar.MONTH or Calendar.YEAR or if the amount is less than 1