CC-5283: Calendar gets messy, possibly after upgrade
This commit is contained in:
parent
7d70a5ed28
commit
06f5f2f5a7
1 changed files with 6 additions and 3 deletions
|
@ -897,6 +897,7 @@ SQL;
|
||||||
Application_Common_DateHelper::ConvertToUtcDateTime($last_show, $timezone) : null;
|
Application_Common_DateHelper::ConvertToUtcDateTime($last_show, $timezone) : null;
|
||||||
|
|
||||||
$previousDate = clone $start;
|
$previousDate = clone $start;
|
||||||
|
|
||||||
foreach ($datePeriod as $date) {
|
foreach ($datePeriod as $date) {
|
||||||
list($utcStartDateTime, $utcEndDateTime) = $this->createUTCStartEndDateTime(
|
list($utcStartDateTime, $utcEndDateTime) = $this->createUTCStartEndDateTime(
|
||||||
$date, $duration);
|
$date, $duration);
|
||||||
|
@ -911,6 +912,7 @@ SQL;
|
||||||
( is_null($utcLastShowDateTime) ||
|
( is_null($utcLastShowDateTime) ||
|
||||||
$utcStartDateTime->format("Y-m-d H:i:s") < $utcLastShowDateTime->format("Y-m-d H:i:s")) ) {
|
$utcStartDateTime->format("Y-m-d H:i:s") < $utcLastShowDateTime->format("Y-m-d H:i:s")) ) {
|
||||||
|
|
||||||
|
$lastCreatedShow = clone $utcStartDateTime;
|
||||||
/* There may not always be an instance when editing a show
|
/* There may not always be an instance when editing a show
|
||||||
* This will be the case when we are adding a new show day to
|
* This will be the case when we are adding a new show day to
|
||||||
* a repeating show
|
* a repeating show
|
||||||
|
@ -960,11 +962,11 @@ SQL;
|
||||||
* If $utcStartDateTime is not set then we know zero new shows were
|
* If $utcStartDateTime is not set then we know zero new shows were
|
||||||
* created and we shouldn't update the next populate date.
|
* created and we shouldn't update the next populate date.
|
||||||
*/
|
*/
|
||||||
if (isset($utcStartDateTime)) {
|
if (isset($lastCreatedShow)) {
|
||||||
/* Set UTC to local time before setting the next repeat date. If we don't
|
/* Set UTC to local time before setting the next repeat date. If we don't
|
||||||
* the next repeat date might be scheduled for the following day */
|
* the next repeat date might be scheduled for the following day */
|
||||||
$utcStartDateTime->setTimezone(new DateTimeZone(Application_Model_Preference::GetTimezone()));
|
$lastCreatedShow->setTimezone(new DateTimeZone(Application_Model_Preference::GetTimezone()));
|
||||||
$nextDate = $utcStartDateTime->add($repeatInterval);
|
$nextDate = $lastCreatedShow->add($repeatInterval);
|
||||||
$this->setNextRepeatingShowDate($nextDate->format("Y-m-d"), $day, $show_id);
|
$this->setNextRepeatingShowDate($nextDate->format("Y-m-d"), $day, $show_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1008,6 +1010,7 @@ SQL;
|
||||||
( is_null($utcLastShowDateTime) ||
|
( is_null($utcLastShowDateTime) ||
|
||||||
$utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp()) ) {
|
$utcStartDateTime->getTimestamp() < $utcLastShowDateTime->getTimestamp()) ) {
|
||||||
|
|
||||||
|
$lastCreatedShow = clone $utcStartDateTime;
|
||||||
/* There may not always be an instance when editing a show
|
/* There may not always be an instance when editing a show
|
||||||
* This will be the case when we are adding a new show day to
|
* This will be the case when we are adding a new show day to
|
||||||
* a repeating show
|
* a repeating show
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue