Elgg  Version 3.0
date.php
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);
10 
12 if (!$value) {
13  return;
14 }
15 
16 try {
18 
20  'datetime' => $dt->format('c'),
21  ];
22 
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 }
$format
Definition: date.php:36
$attributes
Definition: date.php:19
$value
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
$vars['class']
Elgg date input Displays a text field with a popup date picker.
Definition: date.php:20
$dt
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.