<?php } } ?> </select> <input type="submit" value="<?php echo Lang::txt('EVENTS_GO'); ?> " /> </fieldset> </form> <div class="calendarwrap"> <p class="datenav"> <?php $this_date = new \Components\Events\Helpers\EventsDate(); $this_date->setDate($this->year, 0, 0); $prev_year = clone $this_date; $prev_year->addMonths(-12); $next_year = clone $this_date; $next_year->addMonths(+12); $database = App::get('db'); $sql = "SELECT MIN(publish_up) min, MAX(publish_down) max FROM `#__events` as e\n\t\t\t\t\t\t\t\tWHERE `scope`='event'\n\t\t\t\t\t\t\t\tAND `state`=1\n\t\t\t\t\t\t\t\tAND `approved`=1"; $database->setQuery($sql); $rows = $database->loadObjectList(); $first_event_time = new DateTime($rows[0]->min); $last_event_time = new DateTime($rows[0]->max); $this_datetime = new DateTime($this->year . '-01-01'); //get a DateTime for the first day of the year and check if there's an event earlier if ($this_datetime > $first_event_time) { $prev = Route::url('index.php?option=' . $this->option . '&' . $prev_year->toDateURL($this->task));
<?php echo $this->year; ?> </p> </div><!-- / .calendarwrap --> <div class="calendarwrap"> <?php $this->view('calendar')->set('option', $this->option)->set('task', $this->task)->set('year', $this->year)->set('month', $this->month)->set('day', $this->day)->set('offset', $this->offset)->set('shownav', 1)->display(); ?> </div><!-- / .calendarwrap --> <div class="calendarwrap"> <p class="datenav"> <?php $this_date = new \Components\Events\Helpers\EventsDate(); $this_date->setDate($this->year, $this->month, $this->day); $prev_week = clone $this_date; $prev_week->addDays(-7); $next_week = clone $this_date; $next_week->addDays(+7); ?> <a class="prv" href="<?php echo Route::url('index.php?option=' . $this->option . '&' . $prev_week->toDateURL($this->task)); ?> " title="<?php echo Lang::txt('EVENTS_CAL_LANG_PREVIOUSWEEK'); ?> ">‹</a> <a class="nxt" href="<?php echo Route::url('index.php?option=' . $this->option . '&' . $next_week->toDateURL($this->task));
<?php } } ?> </select> <input type="submit" value="<?php echo Lang::txt('EVENTS_GO'); ?> " /> </fieldset> </form> <div class="calendarwrap"> <p class="datenav"> <?php $this_date = new \Components\Events\Helpers\EventsDate(); $this_date->setDate($this->year, $this->month, 0); $prev_year = clone $this_date; $prev_year->addMonths(-12); $next_year = clone $this_date; $next_year->addMonths(+12); $database = App::get('db'); $sql = "SELECT MIN(publish_up) min, MAX(publish_down) max FROM `#__events` as e\n\t\t\t\t\t\t\t\tWHERE `scope`='event'\n\t\t\t\t\t\t\t\tAND `state`=1\n\t\t\t\t\t\t\t\tAND `approved`=1"; $database->setQuery($sql); $rows = $database->loadObjectList(); $first_event_time = new DateTime($rows[0]->min); $last_event_time = new DateTime($rows[0]->max); $this_datetime = new DateTime($this->year . '-01-01'); //get a DateTime for the first day of the year and check if there's an event earlier if ($this_datetime > $first_event_time) { $prev = JRoute::_('index.php?option=' . $this->option . '&' . $prev_year->toDateURL($this->task));