'', 'disabled' => false, 'timestamp' => false, 'type' => 'text' ); $vars = array_merge($defaults, $vars); $timestamp = $vars['timestamp']; unset($vars['timestamp']); if ($timestamp) { echo elgg_view('input/hidden', ['name' => $vars['name'], 'value' => $vars['value']]); $vars['class'][] = 'elgg-input-timestamp'; $vars['id'] = $vars['name']; unset($vars['name']); } // convert timestamps to text for display if (is_numeric($vars['value'])) { $vars['value'] = gmdate('Y-m-d', $vars['value']); } echo elgg_format_element('input', $vars); if (elgg_is_xhr()) { echo elgg_format_element('script', null, 'elgg.ui.initDatePicker();'); }