/** * Get the before date limitation from input or the default one * * @return string * * @since 1.0 */ protected function getBefore() { $before = $this->input->get->getString('before'); // Check if before is set if (isset($before)) { // Convert before to date $date = new JDate($before); // Check if date exists if (!empty($before) && checkdate($date->__get('month'), $date->__get('day'), $date->__get('year'))) { return $date->toSql(); } $this->app->errors->addError("305"); return; } else { // Return the default date $date = new JDate($this->before); return $date->toSql(); } }