CC-5627 : Check all Application_Common_DateHelper calculations that use
timezone. * Fixed GetPlayOrderRange to be consistently return everything in UTC. * ApiController liveInfoAction now returns everything consistently in the station timezone. This fixes negative remaining time that could occur in the embeddable JS Airtime widgets if you were logged in to Airtime while you viewed your website. (The widgets display in the browser's local time.) * ScheduleController getCurrentPlaylistAction() returns everything consistently in the user timezone now.
This commit is contained in:
parent
f2fe04ba1d
commit
a96c2551ef
4 changed files with 48 additions and 12 deletions
|
@ -45,6 +45,29 @@ class Application_Common_DateHelper
|
|||
return gmdate("H:i:s", $this->_dateTime);
|
||||
}
|
||||
|
||||
/** Get the abbreviated timezone for the currently logged in user.
|
||||
* @return A string containing the short form of the timezone set in the preferences for the current user (eg. EST, CEST, etc.)
|
||||
*/
|
||||
public static function getUserTimezoneAbbreviation()
|
||||
{
|
||||
return self::getTimezoneAbbreviation(Application_Model_Preference::GetUserTimezone());
|
||||
}
|
||||
|
||||
/** Get the abbreviated timezone string of the timezone the station is set to.
|
||||
* @return A string containing the short form of the station's timezone (eg. EST, CEST, etc.)
|
||||
*/
|
||||
public static function getStationTimezoneAbbreviation()
|
||||
{
|
||||
return self::getTimezoneAbbreviation(Application_Model_Preference::GetDefaultTimezone());
|
||||
}
|
||||
|
||||
private static function getTimezoneAbbreviation($fullTimeZoneName)
|
||||
{
|
||||
$timeZone = new DateTimeZone($fullTimeZoneName);
|
||||
$now = new DateTime("now", $timeZone);
|
||||
return $now->format("T");
|
||||
}
|
||||
|
||||
public static function getUserTimezoneOffset()
|
||||
{
|
||||
$userTimezone = new DateTimeZone(Application_Model_Preference::GetUserTimezone());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue