aboutsummaryrefslogtreecommitdiff
path: root/views/default/input/date.php
blob: afc40e899b169cb42f81cb352e6836c05d93e744 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
/**
 * Elgg date input
 * Displays a text field with a popup date picker.
 *
 * @package Elgg
 * @subpackage Core
 *
 * @uses $vars['value'] The current value, if any (as a unix timestamp)
 *
 */

$defaults = array(
	'value' => '',
	'class' => '',
);

$vars = array_merge($defaults, $vars);

//@todo popup_calendar deprecated in 1.8.  Remove in 2.0
$vars['class'] = trim("elgg-input-date popup_calendar {$vars['class']}");

if ($vars['value'] > 86400) {
	$vars['value'] = date('n/d/Y', $vars['value']);
}

$attributes = elgg_format_attributes($vars);

?>
<input type="text" <?php echo $attributes; ?> />