alignUntil

fun alignUntil(recur: Recur, startDate: Date): Recur

Aligns the UNTIL of the given recurrence info to the VALUE-type (DATE-TIME/DATE) of startDate.

If the aligned UNTIL is a DATE-TIME, this method also makes sure that it's specified in UTC format as required by RFC 5545 3.3.10.

Return

  • UNTIL not set → original recur

  • UNTIL and DTSTART are both either DATE or DATE-TIME → original recur

  • UNTIL is DATE, DTSTART is DATE-TIME → UNTIL is amended to DATE-TIME with time and timezone from DTSTART

  • UNTIL is DATE-TIME, DTSTART is DATE → UNTIL is reduced to its date component

Parameters

recur

recurrence info whose UNTIL shall be aligned

startDate

DTSTART date to compare with

See also

EndTimeBuilder.alignWithDtStart