-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to transform RRule to text when it has a WEEKLY frequency and no BYDAY #179
Comments
You're right. I faced the same situation. As you wrote it's easy to reproduce. $rrule = new \Recurr\Rule('FREQ=WEEKLY');
$transformer = new \Recurr\Transformer\TextTransformer();
echo $transformer->transform($rrule); The above example will output: Except that, according to the RFC 5545 Section 3.8.2.4, you can read:
So you must explicitelly define a start date in the constructor. $rrule = new \Recurr\Rule('FREQ=WEEKLY', new \DateTime());
$transformer = new \Recurr\Transformer\TextTransformer();
echo $transformer->transform($rrule); The above example will output: Maybe the library should warn the user that the instance lacks of a start date while a rrule is set, avoiding the transformer to throw an exception. |
Hi there!
If you try to parse a rrule with frequency set to WEEKLY and no BYDAY set, it'll give you an error:
Sample code to reproduce the error:
echo (new \Recurr\Transformer\TextTransformer)->transform(new Recurr\Rule('FREQ=WEEKLY'));
This is on version 4.0.2
The text was updated successfully, but these errors were encountered: