parent
277c037779
commit
c69136767e
1 changed files with 8 additions and 6 deletions
|
@ -4,7 +4,7 @@ define("DAYS_PER_WEEK", 7);
|
||||||
|
|
||||||
class WidgetHelper
|
class WidgetHelper
|
||||||
{
|
{
|
||||||
public static function getWeekInfo($timezone)
|
public static function getWeekInfo($userDefinedTimezone)
|
||||||
{
|
{
|
||||||
//weekStart is in station time.
|
//weekStart is in station time.
|
||||||
$weekStartDateTime = Application_Common_DateHelper::getWeekStartDateTime();
|
$weekStartDateTime = Application_Common_DateHelper::getWeekStartDateTime();
|
||||||
|
@ -17,10 +17,12 @@ class WidgetHelper
|
||||||
|
|
||||||
// default to the station timezone
|
// default to the station timezone
|
||||||
$timezone = Application_Model_Preference::GetDefaultTimezone();
|
$timezone = Application_Model_Preference::GetDefaultTimezone();
|
||||||
$userDefinedTimezone = strtolower($timezone);
|
if ($userDefinedTimezone) {
|
||||||
// if the timezone defined by the user exists, use that
|
$userDefinedTimezone = strtolower($userDefinedTimezone);
|
||||||
if (array_key_exists($userDefinedTimezone, timezone_abbreviations_list())) {
|
// if the timezone defined by the user exists, use that
|
||||||
$timezone = $userDefinedTimezone;
|
if (array_key_exists($userDefinedTimezone, timezone_abbreviations_list())) {
|
||||||
|
$timezone = $userDefinedTimezone;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$utcTimezone = new DateTimeZone("UTC");
|
$utcTimezone = new DateTimeZone("UTC");
|
||||||
|
|
||||||
|
@ -170,4 +172,4 @@ class WidgetHelper
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue