From 659d637b5a277a6587c90102dfd4732caf675f8b Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 3 Jan 2018 21:04:52 -0500 Subject: [PATCH] Remove unused param in datetimesel() --- include/datetime.php | 22 ++++++++-------------- mod/events.php | 9 ++------- mod/profiles.php | 5 ----- 3 files changed, 10 insertions(+), 26 deletions(-) diff --git a/include/datetime.php b/include/datetime.php index cb27799798..76196936f6 100644 --- a/include/datetime.php +++ b/include/datetime.php @@ -180,10 +180,6 @@ function datetime_convert($from = 'UTC', $to = 'UTC', $s = 'now', $fmt = "Y-m-d function dob($dob) { list($year,$month,$day) = sscanf($dob,'%4d-%2d-%2d'); - $f = Config::get('system', 'birthday_input_format'); - if (! $f) { - $f = 'ymd'; - } if ($dob <= '0001-01-01') { $value = ''; } else { @@ -228,15 +224,14 @@ function dob($dob) { * * @return string Parsed HTML output. */ -function datesel($format, $min, $max, $default, $id = 'datepicker') { - return datetimesel($format, $min, $max, $default, '', $id, true, false, '', ''); +function datesel($min, $max, $default, $id = 'datepicker') +{ + return datetimesel($min, $max, $default, '', $id, true, false, '', ''); } /** * @brief Returns a time selector * - * @param string $format - * Format string, e.g. 'ymd' or 'mdy'. Not currently supported * @param $h * Already selected hour * @param $m @@ -246,15 +241,14 @@ function datesel($format, $min, $max, $default, $id = 'datepicker') { * * @return string Parsed HTML output. */ -function timesel($format, $h, $m, $id = 'timepicker') { - return datetimesel($format, new DateTime(), new DateTime(), new DateTime("$h:$m"), '', $id, false, true); +function timesel($h, $m, $id = 'timepicker') +{ + return datetimesel(new DateTime(), new DateTime(), new DateTime("$h:$m"), '', $id, false, true); } /** * @brief Returns a datetime selector. * - * @param string $format - * format string, e.g. 'ymd' or 'mdy'. Not currently supported * @param string $min * unix timestamp of minimum date * @param string $max @@ -278,8 +272,8 @@ function timesel($format, $h, $m, $id = 'timepicker') { * @todo Once browser support is better this could probably be replaced with * native HTML5 date picker. */ -function datetimesel($format, $min, $max, $default, $label, $id = 'datetimepicker', $pickdate = true, $picktime = true, $minfrom = '', $maxfrom = '', $required = false) { - +function datetimesel($min, $max, $default, $label, $id = 'datetimepicker', $pickdate = true, $picktime = true, $minfrom = '', $maxfrom = '', $required = false) +{ // First day of the week (0 = Sunday) $firstDay = PConfig::get(local_user(), 'system', 'first_day_of_week', 0); diff --git a/mod/events.php b/mod/events.php index eb804b5d66..0608e8679b 100644 --- a/mod/events.php +++ b/mod/events.php @@ -475,11 +475,6 @@ function events_content(App $a) { $fhour = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'H') : 0); $fminute = ((x($orig_event)) ? datetime_convert('UTC', $tz, $fdt, 'i') : 0); - $f = Config::get('system','event_input_format'); - if (! $f) { - $f = 'ymd'; - } - require_once 'include/acl_selectors.php' ; $perms = get_acl_permissions($orig_event); @@ -511,11 +506,11 @@ function events_content(App $a) { '$title' => t('Event details'), '$desc' => t('Starting date and Title are required.'), '$s_text' => t('Event Starts:') . ' *', - '$s_dsel' => datetimesel($f, new DateTime(), DateTime::createFromFormat('Y', $syear+5), DateTime::createFromFormat('Y-m-d H:i', "$syear-$smonth-$sday $shour:$sminute"), t('Event Starts:'), 'start_text', true, true, '', '', true), + '$s_dsel' => datetimesel(new DateTime(), DateTime::createFromFormat('Y', $syear+5), DateTime::createFromFormat('Y-m-d H:i', "$syear-$smonth-$sday $shour:$sminute"), t('Event Starts:'), 'start_text', true, true, '', '', true), '$n_text' => t('Finish date/time is not known or not relevant'), '$n_checked' => $n_checked, '$f_text' => t('Event Finishes:'), - '$f_dsel' => datetimesel($f, new DateTime(), DateTime::createFromFormat('Y', $fyear+5), DateTime::createFromFormat('Y-m-d H:i', "$fyear-$fmonth-$fday $fhour:$fminute"), t('Event Finishes:'), 'finish_text', true, true, 'start_text'), + '$f_dsel' => datetimesel(new DateTime(), DateTime::createFromFormat('Y', $fyear+5), DateTime::createFromFormat('Y-m-d H:i', "$fyear-$fmonth-$fday $fhour:$fminute"), t('Event Finishes:'), 'finish_text', true, true, 'start_text'), '$a_text' => t('Adjust for viewer timezone'), '$a_checked' => $a_checked, '$d_text' => t('Description:'), diff --git a/mod/profiles.php b/mod/profiles.php index 893f0d51e3..cc01f74dd8 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -655,11 +655,6 @@ function profiles_content(App $a) { $detailled_profile = (PConfig::get(local_user(), 'system', 'detailled_profile') AND $personal_account); - $f = Config::get('system', 'birthday_input_format'); - if (! $f) { - $f = 'ymd'; - } - $is_default = (($r[0]['is-default']) ? 1 : 0); $tpl = get_markup_template("profile_edit.tpl"); $o .= replace_macros($tpl, array(