X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdatetime.php;h=0faea8c90e5fd9e4b8caa31242021f5fb88e584e;hb=104a03e82a1cc4c72de65f27cc5b7953a24bf069;hp=76196936f6f7e39db4b32649d6bd76c329c8e1be;hpb=659d637b5a277a6587c90102dfd4732caf675f8b;p=friendica.git diff --git a/include/datetime.php b/include/datetime.php index 76196936f6..0faea8c90e 100644 --- a/include/datetime.php +++ b/include/datetime.php @@ -102,9 +102,9 @@ function field_timezone($name='timezone', $label='', $current = 'America/Los_Ang $options = str_replace('','', $options); $tpl = get_markup_template('field_select_raw.tpl'); - return replace_macros($tpl, array( - '$field' => array($name, $label, $current, $help, $options), - )); + return replace_macros($tpl, [ + '$field' => [$name, $label, $current, $help, $options], + ]); } @@ -177,8 +177,9 @@ function datetime_convert($from = 'UTC', $to = 'UTC', $s = 'now', $fmt = "Y-m-d * @param string $dob Date of Birth * @return string Formatted html */ -function dob($dob) { - list($year,$month,$day) = sscanf($dob,'%4d-%2d-%2d'); +function dob($dob) +{ + list($year, $month, $day) = sscanf($dob, '%4d-%2d-%2d'); if ($dob <= '0001-01-01') { $value = ''; @@ -188,16 +189,16 @@ function dob($dob) { $age = ((intval($value)) ? age($value, $a->user["timezone"], $a->user["timezone"]) : ""); - $o = replace_macros(get_markup_template("field_input.tpl"), array( - '$field' => array( + $o = replace_macros(get_markup_template("field_input.tpl"), [ + '$field' => [ 'dob', t('Birthday:'), $value, (((intval($age)) > 0 ) ? t('Age: ') . $age : ""), '', 'placeholder="' . t('YYYY-MM-DD or MM-DD') . '"' - ) - )); + ] + ]); /// @TODO Old-lost code? // if ($dob && $dob > '0001-01-01') @@ -211,8 +212,6 @@ function dob($dob) { /** * @brief Returns a date 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 @@ -280,7 +279,7 @@ function datetimesel($min, $max, $default, $label, $id = 'datetimepicker', $pick $lang = substr(get_browser_language(), 0, 2); // Check if the detected language is supported by the picker - if (!in_array($lang, array("ar", "ro", "id", "bg", "fa", "ru", "uk", "en", "el", "de", "nl", "tr", "fr", "es", "th", "pl", "pt", "ch", "se", "kr", "it", "da", "no", "ja", "vi", "sl", "cs", "hu"))) { + if (!in_array($lang, ["ar", "ro", "id", "bg", "fa", "ru", "uk", "en", "el", "de", "nl", "tr", "fr", "es", "th", "pl", "pt", "ch", "se", "kr", "it", "da", "no", "ja", "vi", "sl", "cs", "hu"])) { $lang = Config::get('system', 'language', 'en'); } @@ -328,9 +327,9 @@ function datetimesel($min, $max, $default, $label, $id = 'datetimepicker', $pick $readable_format = str_replace('i','MM',$readable_format); $tpl = get_markup_template('field_input.tpl'); - $o .= replace_macros($tpl, array( - '$field' => array($id, $label, $input_text, '', (($required) ? '*' : ''), 'placeholder="' . $readable_format . '"'), - )); + $o .= replace_macros($tpl, [ + '$field' => [$id, $label, $input_text, '', (($required) ? '*' : ''), 'placeholder="' . $readable_format . '"'], + ]); $o .= "