aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/com/android/calendarcommon/EventRecurrence.java5
-rw-r--r--tests/src/com/android/calendarcommon/EventRecurrenceTest.java7
2 files changed, 6 insertions, 6 deletions
diff --git a/src/com/android/calendarcommon/EventRecurrence.java b/src/com/android/calendarcommon/EventRecurrence.java
index fa5d47c..57a8c20 100644
--- a/src/com/android/calendarcommon/EventRecurrence.java
+++ b/src/com/android/calendarcommon/EventRecurrence.java
@@ -551,6 +551,8 @@ public class EventRecurrence {
* ( ";" x-name "=" text )
* )
*
+ * The rule parts are not ordered in any particular sequence.
+ *
* Examples:
* FREQ=MONTHLY;INTERVAL=2;COUNT=10;BYDAY=1SU,-1SU
* FREQ=YEARLY;INTERVAL=4;BYMONTH=11;BYDAY=TU;BYMONTHDAY=2,3,4,5,6,7,8
@@ -620,9 +622,6 @@ public class EventRecurrence {
if ((parseFlags & flag) != 0) {
throw new InvalidFormatException("Part " + lhs + " was specified twice");
}
- if (parseFlags == 0 && flag != PARSED_FREQ) {
- throw new InvalidFormatException("FREQ must be specified first");
- }
parseFlags |= flag;
}
}
diff --git a/tests/src/com/android/calendarcommon/EventRecurrenceTest.java b/tests/src/com/android/calendarcommon/EventRecurrenceTest.java
index 1bddc61..35777eb 100644
--- a/tests/src/com/android/calendarcommon/EventRecurrenceTest.java
+++ b/tests/src/com/android/calendarcommon/EventRecurrenceTest.java
@@ -711,19 +711,20 @@ public class EventRecurrenceTest extends TestCase {
"FREQ=SECONDLY;BYSECOND=0,15,59",
"FREQ=MINUTELY;BYMINUTE=0,15,59",
"FREQ=HOURLY;BYHOUR=+0,+15,+23",
- "FREQ=DAILY;X-WHATEVER=blah", // fails on old parser
- //"freq=daily;wkst=su", // fails on old parser
+ "INTERVAL=4;FREQ=YEARLY",
+ "FREQ=DAILY;X-WHATEVER=blah",
+ //"freq=daily;wkst=su", // mixed case currently not allowed
};
/** The parser must reject these. */
private static final String[] BAD_RRULES = {
- "INTERVAL=4;FREQ=YEARLY", // FREQ must come first
"FREQ=MONTHLY;FREQ=MONTHLY", // can't specify twice
"FREQ=MONTHLY;COUNT=1;COUNT=1", // can't specify twice
"FREQ=SECONDLY;BYSECOND=60", // range
"FREQ=MINUTELY;BYMINUTE=-1", // range
"FREQ=HOURLY;BYHOUR=24", // range
"FREQ=YEARLY;BYMONTHDAY=0", // zero not valid
+ "BYMONTHDAY=1", // must specify FREQ
//"FREQ=YEARLY;COUNT=1;UNTIL=12345", // can't have both COUNT and UNTIL
//"FREQ=DAILY;UNTIL=19970829T021400e", // invalid date
};