Example #1
0
 private function setBrowseTime(\Core\Application $app, \Core\Http $http)
 {
     $cp = $app->getCurrentPeriod();
     $cp_year = $cp->format('Y');
     $cp_month = $cp->format('n');
     if (isset($http->get()['year'])) {
         $cp_year = $http->get()['year'];
     }
     if (isset($http->get()['month'])) {
         $cp_month = $http->get()['month'];
     }
     $app->setCurrentPeriod((new \DateTime())->setDate($cp_year, $cp_month, 1));
 }