Elgg  Version 4.3
date.php
Go to the documentation of this file.
1 <?php
10 
11 $format = elgg_extract('format', $vars, elgg_get_config('date_format', elgg_echo('input:date_format')), false);
12 
14 if (!$value) {
15  return;
16 }
17 
18 try {
20 
22  'datetime' => $dt->format('c'),
23  ];
24 
25  echo elgg_format_element('time', $attributes, $dt->formatLocale($format));
26 } catch (DataFormatException $ex) {
27  // $value is not a valid datetime, no output
28  return;
29 }
$format
Definition: date.php:39
$attributes
Definition: date.php:21
$value
Definition: date.php:43
elgg_echo($message_key, array $args=[], $language="")
Elgg language module Functions to manage language and translations.
Definition: languages.php:18
$vars['class']
Definition: date.php:23
$dt
Definition: time.php:71
elgg_format_element($tag_name, array $attributes=[], $text= '', array $options=[])
Format an HTML element.
Definition: output.php:135
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:547
An exception thrown when there is a problem in the format of some data.
static normalizeTime($time)
Returns DateTime object based on time representation.
Definition: Values.php:76
elgg echo
Translates a string.
Definition: deprecated.js:530
elgg_get_config($name, $default=null)
Get an Elgg configuration value.