sintonia/airtime_mvc/application/models
Yuchen Wang 6ffecf80c8 CC-2965: Frontend widget displays shows in UTC time
Not only were frontend widgets showing UTC time,
the SQL query was also comparing UTC timestamp with local timestamps,
causing widgets to display shows in the wrong day, etc.

Another problem was that "On air today" widget was simply calling
GetNextShows which returns shows within next 48 hours.

Fixed by:
1. Under models/Show.php:
In the GetCurrentShow/GetNextShows/GetShowsByDayOfWeek functions,
added code to convert UTC timestamp to local timestamp or vice versa,
depending on which one is more suitable, in SQL queries, thus
removing inconsistency in timezones. Also, before returning query result,
added code to convert result to local timezone.

In GetNextShows, added an optional parameter endTime to limit the interval
of shows to get. This is useful for the "On air today" widget.

2. Under models/DateHelper.php:
Added a few timezone functions to help converting timezones easier in Show.php.

3. Under controller/ApiController.php:
Added todayInfoAction which is to be used by "On Air Today" widget.
2011-11-04 16:57:24 -04:00
..
airtime CC-2991: Repeating a show is broken 2011-10-24 16:58:55 -04:00
tests CC-2833: Use ClassLoaders for PHP Files 2011-09-26 15:19:23 -04:00
Alib.php CC-2166: Packaging Improvements. Moved the Zend app into airtime_mvc. It is now installed to /var/www/airtime. Storage is now set to /srv/airtime/stor. Utils are now installed to /usr/lib/airtime/utils/. Added install/airtime-dircheck.php as a simple test to see if everything is install/uninstalled correctly. 2011-04-14 18:55:04 -04:00
Dashboard.php CC-2833: Use ClassLoaders for PHP Files 2011-09-23 16:50:00 -04:00
DateHelper.php CC-2965: Frontend widget displays shows in UTC time 2011-11-04 16:57:24 -04:00
LoginAttempts.php CC-2789: Prevent brue-force password guessing attacks 2011-09-13 14:16:16 -04:00
MusicDir.php Merge branch '1.9.1' into devel 2011-10-04 13:59:27 -04:00
Nowplaying.php CC-2833: Use ClassLoaders for PHP Files 2011-09-26 15:29:12 -04:00
Playlist.php CC-2833: Use ClassLoaders for PHP Files 2011-09-22 12:24:17 -04:00
Preference.php CC-2646: Set a calendar view default (Day/week/month) that's remembered 2011-10-24 12:05:55 -04:00
Prefs.php CC-2833: Use ClassLoaders for PHP Files 2011-09-22 12:24:17 -04:00
RabbitMq.php CC-2956: Undefined variable: endDateTime in 2011-10-11 16:36:01 -04:00
Schedule.php Merge branch '1.9.1' into devel 2011-10-14 01:38:52 +02:00
ScheduleGroup.php CC-2833: Use ClassLoaders for PHP Files 2011-09-26 15:19:23 -04:00
ServiceRegister.php CC-2750: Ability to query health status for pypo, 2011-10-04 15:49:02 -04:00
Show.php CC-2965: Frontend widget displays shows in UTC time 2011-11-04 16:57:24 -04:00
ShowInstance.php CC-2833: Use ClassLoaders for PHP Files 2011-09-26 15:19:23 -04:00
SmilPlaylist.php CC-2833: Use ClassLoaders for PHP Files 2011-09-22 12:24:17 -04:00
Soundcloud.php CC-2993: Playlist Builder: add "View on SoundCloud" option on the menu 2011-10-22 11:34:04 -04:00
StoredFile.php Merge branch 'devel' of dev.sourcefabric.org:airtime into devel 2011-10-22 11:34:43 -04:00
StreamSetting.php CC-2745: Show status of liquidsoap/icecast connection on Stream Settings page 2011-10-23 06:29:06 -04:00
Subjects.php CC-2789: Prevent brue-force password guessing attacks 2011-09-13 14:16:16 -04:00
Systemstatus.php CC-2989: airtime-check-system should deal with the case when the web server is not accessible 2011-10-27 17:13:36 -04:00
User.php CC-2833: Use ClassLoaders for PHP Files 2011-09-23 17:00:55 -04:00
XmlParser.php CC-2166: Packaging Improvements. Moved the Zend app into airtime_mvc. It is now installed to /var/www/airtime. Storage is now set to /srv/airtime/stor. Utils are now installed to /usr/lib/airtime/utils/. Added install/airtime-dircheck.php as a simple test to see if everything is install/uninstalled correctly. 2011-04-14 18:55:04 -04:00
genres.xml CC-2166: Packaging Improvements. Moved the Zend app into airtime_mvc. It is now installed to /var/www/airtime. Storage is now set to /srv/airtime/stor. Utils are now installed to /usr/lib/airtime/utils/. Added install/airtime-dircheck.php as a simple test to see if everything is install/uninstalled correctly. 2011-04-14 18:55:04 -04:00
index.php CC-2166: Packaging Improvements. Moved the Zend app into airtime_mvc. It is now installed to /var/www/airtime. Storage is now set to /srv/airtime/stor. Utils are now installed to /usr/lib/airtime/utils/. Added install/airtime-dircheck.php as a simple test to see if everything is install/uninstalled correctly. 2011-04-14 18:55:04 -04:00