-I've updated the messages used to notify the user to be more explicit.
-I've moved the constant used to track widget api versioning to /application/configs/constants.php
- I updated the ApiController.php file to add a widgetsVersion value used in the response to widgets
- I updated the widgets jquery.showinfo.js file to check the version and report back to the user.
For a previous ticket, I changed the code so that both "Today's Program" widget
and "Now Playing" widget both use the liveInfoAction, but forgot that for "Now Playing" widget, it retrieves
the shows within next 48 hours instead of within end of day today...
Fixed by passing GET parameters to liveInfoAction, specify whether we want to retrieve shows within an
interval or end of day. Also added a GET parameter for specifying the number of shows to display.
It's not showing anything because I thought it's not suppose to display the currently playing show.
Fixed by retrieving the currently playing show along with next shows, and display them.
todayInfoAction is no longer needed since liveInfoAction does the same thing.
- Converting times to UTC timezone in ApiController before sending them to model functions
- Added utility functions in DateHelper.php
- GetShowsByDayOfWeek has been removed due to bugs caused by using local timezone
based variable like $day, which represents day of the week in local time, in db query,
which has times saved in UTC timezone. Converting stuff like day of the week from local
to UTC is messy. GetNextShows(...) can do the job so WeekInfoAction now uses it instead
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.