Skip to content

Commit

Permalink
Avoid Instant temporal type for BYMONTHLY or BYMONTHDAY recurrence rules
Browse files Browse the repository at this point in the history
  • Loading branch information
benfortuna committed Dec 30, 2020
1 parent b2918a6 commit b1df6f6
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 23 deletions.
Expand Up @@ -111,7 +111,7 @@ class ContentBuilder extends FactoryBuilderSupport {
registerFactory('repeat', new DefaultPropertyFactory(klass: Repeat))
registerFactory('requeststatus', new PropertyFactoryWrapper(RequestStatus, new RequestStatus.Factory()))
registerFactory('resources', new DefaultPropertyFactory(klass: Resources))
registerFactory('rrule', new DefaultPropertyFactory(klass: RRule))
registerFactory('rrule', new PropertyFactoryWrapper(RRule, new RRule.Factory()))
registerFactory('sequence', new DefaultPropertyFactory(klass: Sequence))
registerFactory('status', new PropertyFactoryWrapper(Status, new Status.Factory()))
registerFactory('streetaddress', new DefaultPropertyFactory(klass: StreetAddress))
Expand Down
Expand Up @@ -19,6 +19,9 @@
/**
* Applies BYMONTHDAY rules specified in this Recur instance to the specified date list. If no BYMONTHDAY rules are
* specified the date list is returned unmodified.
*
* NOTE: For now BYMONTHDAY is not compatible with Instant temporal type. This is because this rule requires a
* year-month value which is not available from Instant temporal type.
*/
public class ByMonthDayRule<T extends Temporal> extends AbstractDateExpansionRule<T> {

Expand Down
Expand Up @@ -56,33 +56,33 @@ class VEventRecurrenceParametrizedTest extends GroovyTestCase {
['20190527/P1D', '20210524/P1D',
'20230522/P1D']],

['20100831T061500Z', 'DATETIME',
'20100831T064500Z', 'DATETIME',
'FREQ=MONTHLY;UNTIL=20110101',
'20100831T000000Z/20110131T000000Z',
['20100831T061500', 'DATETIME',
'20100831T064500', 'DATETIME',
'FREQ=MONTHLY;UNTIL=20110101T000000',
'20100831T000000/20110131T000000',
null,
['20100831T061500Z/PT30M', '20101031T061500Z/PT30M', '20101231T061500Z/PT30M']],
['20100831T061500/PT30M', '20101031T061500/PT30M', '20101231T061500/PT30M']],

['20100831T061500Z', 'DATETIME',
'20100831T064500Z', 'DATETIME',
'FREQ=MONTHLY;UNTIL=20110101',
'20100831T000000Z/20110131T000000Z',
'20101031T061500Z',
['20100831T061500Z/PT30M', '20101231T061500Z/PT30M']],
['20100831T061500', 'DATETIME',
'20100831T064500', 'DATETIME',
'FREQ=MONTHLY;UNTIL=20110101T000000',
'20100831T000000/20110131T000000',
'20101031T061500',
['20100831T061500/PT30M', '20101231T061500/PT30M']],

['20100831T061500Z', 'DATETIME',
'20100831T064500Z', 'DATETIME',
'FREQ=MONTHLY;UNTIL=20110101;BYMONTHDAY=31',
'20100831T000000Z/20110131T000000Z',
['20100831T061500', 'DATETIME',
'20100831T064500', 'DATETIME',
'FREQ=MONTHLY;UNTIL=20110101T000000;BYMONTHDAY=31',
'20100831T000000/20110131T000000',
null,
['20100831T061500Z/PT30M', '20101031T061500Z/PT30M', '20101231T061500Z/PT30M']],
['20100831T061500/PT30M', '20101031T061500/PT30M', '20101231T061500/PT30M']],

['20100831T061500Z', 'DATETIME',
'20100831T064500Z', 'DATETIME',
'FREQ=MONTHLY;UNTIL=20110101;BYMONTHDAY=31',
'20100831T000000Z/20110131T000000Z',
'20100831T061500Z',
['20101031T061500Z/PT30M', '20101231T061500Z/PT30M']]
['20100831T061500', 'DATETIME',
'20100831T064500', 'DATETIME',
'FREQ=MONTHLY;UNTIL=20110101T000000;BYMONTHDAY=31',
'20100831T000000/20110131T000000',
'20100831T061500',
['20101031T061500/PT30M', '20101231T061500/PT30M']]

]*.toArray()
}
Expand Down

0 comments on commit b1df6f6

Please sign in to comment.