SAAS-929: Shows don't show up on schedule widget on Firefox
This commit is contained in:
parent
ec0fbd2d61
commit
a5a91c25e0
2 changed files with 14 additions and 2 deletions
|
@ -127,6 +127,16 @@ class WidgetHelper
|
||||||
"ALL",
|
"ALL",
|
||||||
$showQueryDateRangeEnd->format("Y-m-d H:i:s"));
|
$showQueryDateRangeEnd->format("Y-m-d H:i:s"));
|
||||||
|
|
||||||
|
// Convert each start and end time string to DateTime objects
|
||||||
|
// so we can get a real timestamp. The timestamps will be used
|
||||||
|
// to convert into javascript Date objects.
|
||||||
|
foreach($shows as &$show) {
|
||||||
|
$dtStarts = new DateTime($show["starts"], new DateTimeZone("UTC"));
|
||||||
|
$show["starts_timestamp"] = $dtStarts->getTimestamp();
|
||||||
|
|
||||||
|
$dtEnds = new DateTime($show["ends"], new DateTimeZone("UTC"));
|
||||||
|
$show["ends_timestamp"] = $dtEnds->getTimestamp();
|
||||||
|
}
|
||||||
$result["shows"] = $shows;
|
$result["shows"] = $shows;
|
||||||
|
|
||||||
// XSS exploit prevention
|
// XSS exploit prevention
|
||||||
|
|
|
@ -40,8 +40,10 @@
|
||||||
|
|
||||||
// First we have to create a Date object out of the show time in UTC.
|
// First we have to create a Date object out of the show time in UTC.
|
||||||
// Then we can format the string in the client's local timezone.
|
// Then we can format the string in the client's local timezone.
|
||||||
var start_date = new Date(value.starts + " UTC");
|
// NOTE: we have to multiply the timestamp by 1000 because in PHP
|
||||||
var end_date = new Date(value.ends + " UTC");
|
// the timestamps are in seconds and are in milliseconds in javascript.
|
||||||
|
var start_date = new Date(value.starts_timestamp*1000);
|
||||||
|
var end_date = new Date(value.ends_timestamp*1000);
|
||||||
|
|
||||||
// This variable is used to identify which schedule_data object (which day of the week)
|
// This variable is used to identify which schedule_data object (which day of the week)
|
||||||
// we should assign the show to.
|
// we should assign the show to.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue