Recent shows go back 2 weeks, next show only shows next week f or now

This commit is contained in:
2017-08-01 02:26:14 +02:00
parent 3ad71819a4
commit d04baa0367
2 changed files with 20 additions and 8 deletions

View File

@@ -10,7 +10,8 @@ class Program extends Model {
public $priority;
public $hosts;
public $schedule;
public $recent;
public $next;
public function __construct($data) {
parent::__construct($data);
@@ -19,13 +20,10 @@ class Program extends Model {
$this->name .= ' ' . $data->suffix;
}
if($this->schedule && $this->schedule->next && $this->schedule->next->time) {
parent::ConvertToDateTime($this->schedule->next->time);
}
if($this->schedule && $this->schedule->recent) {
foreach($this->schedule->recent as &$recent) {
parent::ConvertToDateTime($recent->time);
parent::ConvertToDateTime($this->next);
if($this->recent && $this->recent) {
foreach($this->recent as &$recent) {
parent::ConvertToDateTime($recent);
}
}