We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi,
because loadFromString actually makes a explode(';') to create an array for loadFromArray, timezones are broken here, e.g.:
DTSTART;TZID=UTC:20150209T153000
This is not covered by the unittest :(
I suggest to extend each test to be sure that results from getString() can always be used to recreate the object and both are equal:
$begin = new DateTimeImmutable('2012-08-01'); $end = new DateTimeImmutable('2012-08-31'); $rule = new Rule('FREQ=WEEKLY;COUNT=5'); $rule->setStartDate($begin, true); $rule->setEndDate($end); $string = $rule->getString(); $ruleRestored = Rule::createFromString($string); $this->assertEquals($rule, $ruleRestored); // Fails
Similar problem is, that you can control, to add/remove DTSTART for the rules, but not DTEND, so this also is not predictable, this test fails also:
$begin = new DateTime('2012-08-01'); $end = new DateTime('2012-08-31'); $xmas = new DateTime('2012-12-25'); $rule = new Rule('FREQ=WEEKLY;COUNT=5', $begin, $end); $string = $rule->getString(); $this->assertEquals('FREQ=WEEKLY;COUNT=5;DTEND=20120831T000000', $string); // passes $ruleRestored = new Rule($rule->getString(), $begin, $xmas); $this->assertNotEquals($rule, $ruleRestored); // fails
But this has a total different behaviour:
$begin = new DateTimeImmutable('2012-08-01'); $end = new DateTimeImmutable('2012-08-31'); $xmas = new DateTimeImmutable('2012-12-25'); $rule = new Rule('FREQ=WEEKLY;COUNT=5', $begin, $end); $string = $rule->getString(); $this->assertEquals('FREQ=WEEKLY;COUNT=5;DTEND=20120831T000000', $string); // fails $ruleRestored = new Rule($rule->getString(), $begin, $xmas); $this->assertNotEquals($rule, $ruleRestored); // unknown
Here we don't get any DTEND, because of
// DTEND if ($this->endDate instanceof \DateTime) {
This should check for DateTimeInterface I guess.
Thanks for your work, best regards Gregor
The text was updated successfully, but these errors were encountered:
Merge pull request #1 from ftcvlad/tzid-bugfixes
3ad214f
RFC compliance and fixes for issue simshaun#137
DTSTART
RRULE
Successfully merging a pull request may close this issue.
Hi,
because loadFromString actually makes a explode(';') to create an array for loadFromArray, timezones are broken here, e.g.:
This is not covered by the unittest :(
I suggest to extend each test to be sure that results from getString() can always be used to recreate the object and both are equal:
Similar problem is, that you can control, to add/remove DTSTART for the rules, but not DTEND, so this also is not predictable, this test fails also:
But this has a total different behaviour:
Here we don't get any DTEND, because of
This should check for DateTimeInterface I guess.
Thanks for your work, best regards
Gregor
The text was updated successfully, but these errors were encountered: