Elgg  Version 3.0
Go to the documentation of this file.
1 <?php
9 $format = elgg_extract('format', $vars, elgg_get_config('date_format', elgg_echo('input:date_format')), false);
12 if (!$value) {
13  return;
14 }
16 try {
20  'datetime' => $dt->format('c'),
21  ];
23  echo elgg_format_element('time', $attributes, $dt->formatLocale($format));
24 } catch (DataFormatException $ex) {
25  // $value is not a valid datetime, no output
26  return;
27 }
Definition: date.php:36
Definition: date.php:19
Definition: date.php:40
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
Elgg date input Displays a text field with a popup date picker.
Definition: date.php:20
Definition: time.php:69
elgg_format_element($tag_name, array $attributes=[], $text= '', array $options=[])
Format an HTML element.
Definition: output.php:168
elgg echo
Translates a string.
Definition: languages.js:43
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1131
static normalizeTime($time)
Returns DateTime object based on time representation.
Definition: Values.php:76
elgg_get_config($name, $default=null)
Get an Elgg configuration value.