define(["datetime","listView","loading"],function(datetime,listView,loading){"use strict";function isSameDay(date1,date2){return date1.toDateString()===date2.toDateString()}function renderPrograms(page,result){for(var html="",currentItems=[],currentStartDate=null,i=0,length=result.Items.length;i"+datetime.toLocaleDateString(currentStartDate,{weekday:"long",month:"long",day:"numeric"})+"",html+='
'+listView.getListViewHtml({items:currentItems,enableUserDataButtons:!1,showParentTitle:!0,image:!1,showProgramTime:!0,mediaInfo:!1,parentTitleWithTitle:!0})+"
"),currentStartDate=itemStartDate,currentItems=[]),currentItems.push(item)}page.querySelector("#childrenContent").innerHTML=html}function loadPrograms(page,channelId){ApiClient.getLiveTvPrograms({ChannelIds:channelId,UserId:Dashboard.getCurrentUserId(),HasAired:!1,SortBy:"StartDate",EnableTotalRecordCount:!1,EnableImages:!1,ImageTypeLimit:0,EnableUserData:!1}).then(function(result){renderPrograms(page,result),loading.hide()})}return{renderPrograms:loadPrograms}});