0

I'm having trouble understanding the rfc5545 concerning the the until and count. From what I understand, UNTIL and COUNT cannot be in the same recur rule according to this part of the RFC:

Value Name: RECUR

Purpose: This value type is used to identify properties that contain a recurrence rule specification.

Formal Definition: The value type is defined by the following
notation:

 recur      = "FREQ"=freq *(

            ; either UNTIL or COUNT may appear in a 'recur',
            ; but UNTIL and COUNT MUST NOT occur in the same 'recur'
...

Further in the rfc, this is stated:

If multiple BYxxx rule parts are specified, then after evaluating the specified FREQ and INTERVAL rule parts, the BYxxx rule parts are applied to the current set of evaluated occurrences in the following order: BYMONTH, BYWEEKNO, BYYEARDAY, BYMONTHDAY, BYDAY, BYHOUR, BYMINUTE, BYSECOND and BYSETPOS; then COUNT and UNTIL are evaluated.

This last paragraph seems to imply that the COUNT and UNTIL can be in the same RRULE.

When I check libraries that implement rrule generator and parsing, there is no validation that make sure that the the COUNT and UNTIL are not in the same recur.

What is the general implementation that everyone usually do with this ? Should we ignore this validation and simply use the UNTIL parameter when there is both COUNT and UNTIL (or vice versa) ? What does the RFC mean exactly concerning the COUNT and UNTIL parameter ?

Community
  • 1
  • 1
Nico
  • 6,395
  • 4
  • 25
  • 34

1 Answers1

0

I don't think you can derive from the second paragraph that having both is valid.

There is only one definition of RECUR and the cardinality of its various components: the ABNF definition. This is where you should go to check the validity of your property. The second paragraph simply describes the algorithm to use for doing RRULE expansion.

Arnaud Quillaud
  • 4,420
  • 1
  • 12
  • 8