Elgg  Version 3.0
Variables
date.php File Reference

Go to the source code of this file.

Variables

 $vars ['class'] = elgg_extract_class($vars, 'elgg-input-date')
 Elgg date input Displays a text field with a popup date picker. More...
 
 $defaults
 
 $timestamp = elgg_extract('timestamp', $vars)
 
 $format = elgg_extract('format', $vars, $defaults['format'], false)
 
 $name = elgg_extract('name', $vars)
 
 $value = elgg_extract('value', $vars)
 
 $value_date = ''
 
 $value_timestamp = ''
 
if($value) if($timestamp) $vars ['value'] = $value_date
 
 $datepicker_options = (array) elgg_extract('datepicker_options', $vars, [])
 
if(empty($datepicker_options['dateFormat'])) $vars ['data-datepicker-opts'] = $datepicker_options ? json_encode($datepicker_options) : ''
 
if(isset($vars['id'])) else
 

Variable Documentation

$datepicker_options = (array) elgg_extract('datepicker_options', $vars, [])

Definition at line 71 of file date.php.

$defaults
Initial value:
= [
'value' => ''

Definition at line 22 of file date.php.

$format = elgg_extract('format', $vars, $defaults['format'], false)

Definition at line 36 of file date.php.

$name = elgg_extract('name', $vars)

Definition at line 39 of file date.php.

$timestamp = elgg_extract('timestamp', $vars)

Definition at line 33 of file date.php.

$value = elgg_extract('value', $vars)

Definition at line 40 of file date.php.

$value_date = ''

Definition at line 42 of file date.php.

$value_timestamp = ''

Definition at line 43 of file date.php.

$vars = elgg_extract_class($vars, 'elgg-input-date')

Elgg date input Displays a text field with a popup date picker.

The elgg.ui JavaScript library initializes the jQueryUI datepicker based on the CSS class .elgg-input-date. It uses the ISO 8601 standard for date representation: yyyy-mm-dd.

Unix timestamps are supported by setting the 'timestamp' parameter to true. The date is still displayed to the user in a text format but is submitted as a unix timestamp in seconds.

$vars['value'] The current value, if any (as a unix timestamp) $vars['class'] Additional CSS class $vars['timestamp'] Store as a Unix timestamp in seconds. Default = false $vars['datepicker_options'] An array of options to pass to the jQuery UI datepicker $vars['format'] Date format, default Y-m-d (2018-01-30)

Definition at line 20 of file date.php.

if ($value) if ($timestamp) $vars['value'] = $value_date

Definition at line 69 of file date.php.

if (empty($datepicker_options['dateFormat'])) $vars['data-datepicker-opts'] = $datepicker_options ? json_encode($datepicker_options) : ''

Definition at line 78 of file date.php.

if (isset($vars['id'])) else
Initial value:
{
$selector = ".elgg-input-date[name='{$name}']"

Definition at line 84 of file date.php.