Merge branch 'saas-dev' into soundcloud
Conflicts: airtime_mvc/application/configs/constants.php
This commit is contained in:
commit
5cc8774e56
30 changed files with 194 additions and 182 deletions
|
@ -15,7 +15,7 @@ class Application_Common_DateHelper
|
|||
*/
|
||||
function getTimestamp()
|
||||
{
|
||||
return date("Y-m-d H:i:s", $this->_dateTime);
|
||||
return date(DEFAULT_TIMESTAMP_FORMAT, $this->_dateTime);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -24,7 +24,7 @@ class Application_Common_DateHelper
|
|||
*/
|
||||
function getUtcTimestamp()
|
||||
{
|
||||
return gmdate("Y-m-d H:i:s", $this->_dateTime);
|
||||
return gmdate(DEFAULT_TIMESTAMP_FORMAT, $this->_dateTime);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -249,7 +249,7 @@ class Application_Common_DateHelper
|
|||
*
|
||||
* @return string in $format default Y-m-d H:i:s in station timezone
|
||||
*/
|
||||
public static function UTCStringToStationTimezoneString($datetime, $format="Y-m-d H:i:s") {
|
||||
public static function UTCStringToStationTimezoneString($datetime, $format=DEFAULT_TIMESTAMP_FORMAT) {
|
||||
$stationTimezone = new DateTimeZone(Application_Model_Preference::GetDefaultTimezone());
|
||||
$utcTimezone = new DateTimeZone("UTC");
|
||||
|
||||
|
@ -264,7 +264,7 @@ class Application_Common_DateHelper
|
|||
*
|
||||
* @return string Y-m-d H:i:s in user's timezone
|
||||
*/
|
||||
public static function UTCStringToUserTimezoneString($datetime, $format="Y-m-d H:i:s") {
|
||||
public static function UTCStringToUserTimezoneString($datetime, $format=DEFAULT_TIMESTAMP_FORMAT) {
|
||||
$userTimezone = new DateTimeZone(Application_Model_Preference::GetUserTimezone());
|
||||
$utcTimezone = new DateTimeZone("UTC");
|
||||
|
||||
|
@ -279,7 +279,7 @@ class Application_Common_DateHelper
|
|||
*
|
||||
* @return string Y-m-d H:i:s in UTC timezone
|
||||
*/
|
||||
public static function UserTimezoneStringToUTCString($datetime, $format="Y-m-d H:i:s") {
|
||||
public static function UserTimezoneStringToUTCString($datetime, $format=DEFAULT_TIMESTAMP_FORMAT) {
|
||||
$userTimezone = new DateTimeZone(Application_Model_Preference::GetUserTimezone());
|
||||
$utcTimezone = new DateTimeZone("UTC");
|
||||
|
||||
|
@ -321,7 +321,7 @@ class Application_Common_DateHelper
|
|||
* @param string $timezone convert to the given timezone.
|
||||
* @param string $format time format to convert to
|
||||
*/
|
||||
public static function convertTimestampsToTimezone(&$rows, $columnsToConvert, $timezone, $format="Y-m-d H:i:s")
|
||||
public static function convertTimestampsToTimezone(&$rows, $columnsToConvert, $timezone, $format=DEFAULT_TIMESTAMP_FORMAT)
|
||||
{
|
||||
$timezone = strtolower($timezone);
|
||||
// Check that the timezone is valid and rows is an array
|
||||
|
@ -370,7 +370,7 @@ class Application_Common_DateHelper
|
|||
* @param unknown $timezone the timezone to convert to
|
||||
* @param string $format the formatted string
|
||||
*/
|
||||
public static function UTCStringToTimezoneString($datetime, $timezone, $format="Y-m-d H:i:s") {
|
||||
public static function UTCStringToTimezoneString($datetime, $timezone, $format=DEFAULT_TIMESTAMP_FORMAT) {
|
||||
$d = new DateTime($datetime, new DateTimeZone("UTC"));
|
||||
$timezone = strtolower($timezone);
|
||||
$newTimezone = new DateTimeZone($timezone);
|
||||
|
|
|
@ -25,7 +25,7 @@ class WidgetHelper
|
|||
$utcTimezone = new DateTimeZone("UTC");
|
||||
|
||||
$weekStartDateTime->setTimezone($utcTimezone);
|
||||
$utcDayStart = $weekStartDateTime->format("Y-m-d H:i:s");
|
||||
$utcDayStart = $weekStartDateTime->format(DEFAULT_TIMESTAMP_FORMAT);
|
||||
for ($i = 0; $i < 14; $i++) {
|
||||
//have to be in station timezone when adding 1 day for daylight savings.
|
||||
$weekStartDateTime->setTimezone(new DateTimeZone($timezone));
|
||||
|
@ -34,7 +34,7 @@ class WidgetHelper
|
|||
//convert back to UTC to get the actual timestamp used for search.
|
||||
$weekStartDateTime->setTimezone($utcTimezone);
|
||||
|
||||
$utcDayEnd = $weekStartDateTime->format("Y-m-d H:i:s");
|
||||
$utcDayEnd = $weekStartDateTime->format(DEFAULT_TIMESTAMP_FORMAT);
|
||||
$shows = Application_Model_Show::getNextShows($utcDayStart, "ALL", $utcDayEnd);
|
||||
$utcDayStart = $utcDayEnd;
|
||||
|
||||
|
@ -84,11 +84,11 @@ class WidgetHelper
|
|||
// a time of "00:00". $utcDayStart is used below when querying for shows.
|
||||
$utcDayStartDT = clone $weekStartDateTime;
|
||||
$utcDayStartDT->setTime(0, 0, 0);
|
||||
$utcDayStart = $utcDayStartDT->format("Y-m-d H:i:s");
|
||||
$utcDayStart = $utcDayStartDT->format(DEFAULT_TIMESTAMP_FORMAT);
|
||||
$weekCounter = 0;
|
||||
while ($weekCounter < $maxNumOFWeeks) {
|
||||
for ($dayOfWeekCounter = 0; $dayOfWeekCounter < DAYS_PER_WEEK; $dayOfWeekCounter++) {
|
||||
$dateParse = date_parse($weekStartDateTime->format("Y-m-d H:i:s"));
|
||||
$dateParse = date_parse($weekStartDateTime->format(DEFAULT_TIMESTAMP_FORMAT));
|
||||
|
||||
$result[$weekCounter][$dayOfWeekCounter]["dayOfMonth"] = $dateParse["day"];
|
||||
$result[$weekCounter][$dayOfWeekCounter]["dayOfWeek"] = strtoupper(date("D", $weekStartDateTime->getTimestamp()));
|
||||
|
@ -104,7 +104,7 @@ class WidgetHelper
|
|||
// a time of "00:00".
|
||||
$utcDayEndDT = clone $weekStartDateTime;
|
||||
$utcDayEndDT->setTime(0, 0, 0);
|
||||
$utcDayEnd = $utcDayEndDT->format("Y-m-d H:i:s");
|
||||
$utcDayEnd = $utcDayEndDT->format(DEFAULT_TIMESTAMP_FORMAT);
|
||||
$shows = Application_Model_Show::getNextShows($utcDayStart, "ALL", $utcDayEnd);
|
||||
$utcDayStart = $utcDayEnd;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue