Merge branch '2.1.x' into devel
This commit is contained in:
commit
9b31a6daac
2 changed files with 14 additions and 16 deletions
|
@ -53,7 +53,7 @@ class Application_Common_DateHelper
|
||||||
*/
|
*/
|
||||||
function getWeekStartDate()
|
function getWeekStartDate()
|
||||||
{
|
{
|
||||||
$startDate = date('w') == 0 ? date('Y-m-d') : date('Y-m-d', strtotime('monday'));
|
$startDate = date('w') == 0 ? date('Y-m-d') : date('Y-m-d', strtotime('monday this week'));
|
||||||
$startDateTime = new DateTime($startDate);
|
$startDateTime = new DateTime($startDate);
|
||||||
return $startDateTime->format('Y-m-d H:i:s');
|
return $startDateTime->format('Y-m-d H:i:s');
|
||||||
}
|
}
|
||||||
|
|
|
@ -1310,7 +1310,7 @@ class Application_Model_Show {
|
||||||
|
|
||||||
if ($ccShowInstance->getDbModifiedInstance()){
|
if ($ccShowInstance->getDbModifiedInstance()){
|
||||||
//show instance on this date has been deleted.
|
//show instance on this date has been deleted.
|
||||||
$utcStartDateTime = self::advanceRepeatingDate($p_interval, $start, $timezone);
|
list($start, $utcStartDateTime) = self::advanceRepeatingDate($p_interval, $start, $timezone);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1343,7 +1343,7 @@ class Application_Model_Show {
|
||||||
|
|
||||||
$showInstance->deleteRebroadcasts();
|
$showInstance->deleteRebroadcasts();
|
||||||
self::createRebroadcastInstances($rebroadcasts, $currentUtcTimestamp, $show_id, $show_instance_id, $start, $duration, $timezone);
|
self::createRebroadcastInstances($rebroadcasts, $currentUtcTimestamp, $show_id, $show_instance_id, $start, $duration, $timezone);
|
||||||
$utcStartDateTime = self::advanceRepeatingDate($p_interval, $start, $timezone);
|
list($start, $utcStartDateTime) = self::advanceRepeatingDate($p_interval, $start, $timezone);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1359,31 +1359,29 @@ class Application_Model_Show {
|
||||||
* over the years 2011->2012, etc.). Then let's append the actual day, and use the php
|
* over the years 2011->2012, etc.). Then let's append the actual day, and use the php
|
||||||
* checkdate() function, to see if it is valid. If not, then we'll just skip this month. */
|
* checkdate() function, to see if it is valid. If not, then we'll just skip this month. */
|
||||||
|
|
||||||
/* pass in only the year and month (not the day) */
|
/* pass in only the year and month (not the day) */
|
||||||
$dt = new DateTime($startDt->format("Y-m"), new DateTimeZone($timezone));
|
|
||||||
|
|
||||||
$dt = new DateTime($startDt->format("Y-m"), new DateTimeZone($timezone));
|
$dt = new DateTime($startDt->format("Y-m"), new DateTimeZone($timezone));
|
||||||
|
|
||||||
|
|
||||||
/* Keep adding 1 month, until we find the next month that contains the day
|
/* Keep adding 1 month, until we find the next month that contains the day
|
||||||
* we are looking for (31st day for example) */
|
* we are looking for (31st day for example) */
|
||||||
do {
|
do {
|
||||||
$dt->add(new DateInterval($p_interval));
|
$dt->add(new DateInterval($p_interval));
|
||||||
} while(!checkdate($dt->format("m"), $startDt->format("d"), $dt->format("Y")));
|
} while(!checkdate($dt->format("m"), $startDt->format("d"), $dt->format("Y")));
|
||||||
|
|
||||||
$dt->setDate($dt->format("Y"), $dt->format("m"), $startDt->format("d"));
|
$dt->setDate($dt->format("Y"), $dt->format("m"), $startDt->format("d"));
|
||||||
|
|
||||||
$start = $dt->format("Y-m-d H:i:s");
|
|
||||||
|
|
||||||
$dt->setTimezone(new DateTimeZone('UTC'));
|
|
||||||
$utcStartDateTime = $dt;
|
|
||||||
} else {
|
} else {
|
||||||
$dt = new DateTime($start, new DateTimeZone($timezone));
|
$dt = new DateTime($start, new DateTimeZone($timezone));
|
||||||
$dt->add(new DateInterval($p_interval));
|
$dt->add(new DateInterval($p_interval));
|
||||||
$start = $dt->format("Y-m-d H:i:s");
|
|
||||||
|
|
||||||
$dt->setTimezone(new DateTimeZone('UTC'));
|
|
||||||
$utcStartDateTime = $dt;
|
|
||||||
}
|
}
|
||||||
return $utcStartDateTime;
|
|
||||||
|
$start = $dt->format("Y-m-d H:i:s");
|
||||||
|
|
||||||
|
$dt->setTimezone(new DateTimeZone('UTC'));
|
||||||
|
$utcStartDateTime = $dt;
|
||||||
|
|
||||||
|
return array($start, $utcStartDateTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue