Schedule/Recent toegevoegd.

This commit is contained in:
2020-02-09 16:28:08 +01:00
parent 1b7527cccf
commit 22acca0e05
2 changed files with 12 additions and 0 deletions

View File

@@ -290,6 +290,17 @@ QUERY;
return response()->json($schema); return response()->json($schema);
} }
/**
* Recente programma's (max. 2 weken geleden)
*/
public function recent() {
$einde = new \DateTimeImmutable('now');
$start = $einde->add(\DateInterval::createFromDateString('today - 13 days'));
$schema = $this->createSchedule($start, $einde);
return response()->json($schema);
}
/** /**
* Programmaschema per week * Programmaschema per week
*/ */

View File

@@ -44,6 +44,7 @@ $app->get('podcast/stream/{id:\d+}/{title}', 'PodcastController@stream' );
$app->get('programma/schema/onair', 'ProgramController@onair' ); $app->get('programma/schema/onair', 'ProgramController@onair' );
$app->get('programma/schema/nustraks', 'ProgramController@comingup' ); $app->get('programma/schema/nustraks', 'ProgramController@comingup' );
$app->get('programma/schema/recent', 'ProgramController@recent' );
$app->get('programma/schema/week[/{shiftWeeks:-?\d+}]', 'ProgramController@schedule' ); $app->get('programma/schema/week[/{shiftWeeks:-?\d+}]', 'ProgramController@schedule' );
$app->get('programma/schema/maand/{year:20\d\d}/{month:\d\d?}', 'ProgramController@month' ); $app->get('programma/schema/maand/{year:20\d\d}/{month:\d\d?}', 'ProgramController@month' );
$app->get('programma/schema/periode/{from:\d\d\d\d-\d\d?-\d\d?}/{to:\d\d\d\d-\d\d?-\d\d?}', 'ProgramController@period' ); $app->get('programma/schema/periode/{from:\d\d\d\d-\d\d?-\d\d?}/{to:\d\d\d\d-\d\d?-\d\d?}', 'ProgramController@period' );