CC-3478: Calendar->Show has some inconsistencies on special Days (e.g.
switching to Daylight Saving Time) - fixed
This commit is contained in:
parent
5c401cb472
commit
fe71487fa2
2 changed files with 46 additions and 29 deletions
|
@ -31,6 +31,7 @@ class ScheduleController extends Zend_Controller_Action
|
|||
->addActionContext('set-time-interval', 'json')
|
||||
->addActionContext('edit-show-instance', 'json')
|
||||
->addActionContext('dj-edit-show', 'json')
|
||||
->addActionContext('calculate-duration', 'json')
|
||||
->initContext();
|
||||
|
||||
$this->sched_sess = new Zend_Session_Namespace("schedule");
|
||||
|
@ -891,12 +892,25 @@ class ScheduleController extends Zend_Controller_Action
|
|||
public function setTimeIntervalAction() {
|
||||
Application_Model_Preference::SetCalendarTimeInterval($this->_getParam('timeInterval'));
|
||||
}
|
||||
|
||||
public function calculateDurationAction() {
|
||||
global $CC_CONFIG;
|
||||
|
||||
$startParam = $this->_getParam('startTime');
|
||||
$endParam = $this->_getParam('endTime');
|
||||
|
||||
$startDateTime = new DateTime($startParam);
|
||||
$endDateTime = new DateTime($endParam);
|
||||
|
||||
$UTCStartDateTime = $startDateTime->setTimezone(new DateTimeZone('UTC'));
|
||||
$UTCEndDateTime = $endDateTime->setTimezone(new DateTimeZone('UTC'));
|
||||
|
||||
$duration = $UTCEndDateTime->diff($UTCStartDateTime);
|
||||
|
||||
$result = $duration->format('%r%Hh %Im');
|
||||
|
||||
echo Zend_Json::encode($result);
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue