Merge branch 'saas-dev' into saas-stream-settings

This commit is contained in:
Duncan Sommerville 2015-07-08 12:47:24 -04:00
commit 6b9d9e8063
17 changed files with 186 additions and 141 deletions

View file

@ -40,8 +40,10 @@
// 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.
var start_date = new Date(value.starts + " UTC");
var end_date = new Date(value.ends + " UTC");
// NOTE: we have to multiply the timestamp by 1000 because in PHP
// 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)
// we should assign the show to.
@ -53,13 +55,17 @@
if ($window.schedule_data["weekDays"][format_start_date] !== undefined) {
$window.schedule_data["weekDays"][format_start_date]["shows"].push(
{
"show_start_hour": start_date.getHours().toString().paddingLeft("00")+":"+ start_date.getMinutes().toString().paddingLeft("00"),
"show_end_hour": end_date.getHours().toString().paddingLeft("00")+":"+ end_date.getMinutes().toString().paddingLeft("00"),
"show_start_hour": start_date.toLocaleTimeString([], { hour: 'numeric', minute : 'numeric' }),
"show_end_hour": end_date.toLocaleTimeString([], { hour: 'numeric', minute : 'numeric' }),
"name": value.name
});
}
});
$scope.weekDays = $window.schedule_data["weekDays"];
// Convert the object into an array to maintain the same order when we
// iterate over each weekday
$scope.weekDays = $.map($window.schedule_data["weekDays"], function(value, index) {
return [value];
});
$scope.isEmpty = function(obj) {
return obj.length == 0;