MDL-63275 calendar: Properly calculate expected until date
This commit is contained in:
committed by
David Monllao
parent
6a4d4f2ba4
commit
8c04f87af5
@@ -695,7 +695,9 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
|
||||
$rrule = "FREQ=MONTHLY;INTERVAL=12;BYMONTHDAY=2";
|
||||
|
||||
$mang = new rrule_manager($rrule);
|
||||
$until = time() + (YEARSECS * $mang::TIME_UNLIMITED_YEARS);
|
||||
$untildate = new DateTime();
|
||||
$untildate->add(new DateInterval('P' . $mang::TIME_UNLIMITED_YEARS . 'Y'));
|
||||
$until = $untildate->getTimestamp();
|
||||
|
||||
$mang->parse_rrule();
|
||||
$mang->create_events($this->event);
|
||||
@@ -850,7 +852,9 @@ class core_calendar_rrule_manager_testcase extends advanced_testcase {
|
||||
$rrule = "FREQ=MONTHLY;INTERVAL=12;BYDAY=1MO";
|
||||
|
||||
$mang = new rrule_manager($rrule);
|
||||
$until = time() + (YEARSECS * $mang::TIME_UNLIMITED_YEARS);
|
||||
$untildate = new DateTime();
|
||||
$untildate->add(new DateInterval('P' . $mang::TIME_UNLIMITED_YEARS . 'Y'));
|
||||
$until = $untildate->getTimestamp();
|
||||
|
||||
$mang->parse_rrule();
|
||||
$mang->create_events($this->event);
|
||||
|
||||
Reference in New Issue
Block a user