/** * * @return array dates - since, till */ public static function orderDates() { $since = Defaults::firstOfThisYear(); $till = Defaults::today(); if (!empty($_POST['since']) && $_POST['since'] <= Defaults::today()) { $since = $_POST['since']; } if (!empty($_POST['till']) && $_POST['till'] <= Defaults::today()) { $till = $_POST['till']; } if ($since > $till) { $inter = $till; $till = $since; $since = $inter; } return array('since' => $since, 'till' => $till); }