Go to the source code of this file.
|
| $vars ['class'] = elgg_extract_class($vars, 'elgg-input-time') |
| Elgg time input Displays a select field with time options. More...
|
|
| $defaults |
|
| $timestamp = elgg_extract('timestamp', $vars) |
|
| $format = elgg_extract('format', $vars, $defaults['format'], false) |
|
| $min = (int) elgg_extract('min', $vars, 0) |
|
| $max = (int) elgg_extract('max', $vars, 24 * 60 * 60) |
|
| $step = (int) elgg_extract('step', $vars, 15 * 60) |
|
| $value = elgg_extract('value', $vars) |
|
| $value_time = '' |
|
| $value_timestamp = '' |
|
if($value) if($timestamp) | else |
|
| $hour_options = [] |
|
| $hour_options_ts = range($min, $max, $step) |
|
| $dt = new DateTime(null, new DateTimeZone('UTC')) |
|
foreach($hour_options_ts as $ts) | $vars ['options_values'] = $hour_options |
|
Initial value:
Definition at line 18 of file time.php.
$dt = new DateTime(null, new DateTimeZone('UTC')) |
$format = elgg_extract('format', $vars, $defaults['format'], false) |
$hour_options_ts = range($min, $max, $step) |
Elgg time input Displays a select field with time options.
Unix timestamps are supported by setting the 'timestamp' parameter to true.
$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['format'] Date format, default g:ia (4:44pm) $vars['step'] Interval/step (in seconds) between available time options (e.g. 15*60 for 15min) $vars['min'] Min available time in seconds (e.g. 2*60*60 for 2am) $vars['max'] Max available time in seconds (e.g. 23*60*60 for 11pm)
Definition at line 16 of file time.php.
foreach ($hour_options_ts as $ts) $vars['options_values'] = $hour_options |
Initial value:
Definition at line 62 of file time.php.