diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index f5cac2aa0..bfcd9edd0 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -1082,6 +1082,14 @@ SQL; $event["rebroadcast"] = intval($show["rebroadcast"]); $event["soundcloud_id"] = is_null($show["soundcloud_id"]) ? -1 : $show["soundcloud_id"]; + + //for putting the now playing icon on the show. + if ($now > $startsDT && $now < $endsDT) { + $event["nowPlaying"] = true; + } + else { + $event["nowPlaying"] = false; + } //event colouring if ($show["color"] != "") { diff --git a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js index 6f67364a2..053df0362 100644 --- a/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js +++ b/airtime_mvc/public/js/airtime/schedule/full-calendar-functions.js @@ -288,6 +288,21 @@ function eventRender(event, element, view) { $(element).find(".fc-event-title").after(''); } } + + //now playing icon. + var span = ''; + + if (event.nowPlaying === true) { + + if (view_name === 'agendaDay' || view_name === 'agendaWeek') { + + $(element).find(".fc-event-time").before(span); + } + else if (view_name === 'month') { + + $(element).find(".fc-event-title").after(span); + } + } } function eventAfterRender( event, element, view ) {