aboutsummaryrefslogtreecommitdiff
path: root/views/default/input/date.php
blob: e21a5f8f5e4ae9717a7edfbaabb18fbccc344d0a (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
31
32
33
34
35
<?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)
 * @uses $vars['class'] Additional CSS class
 */

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

$defaults = array(
	'value' => '',
	'disabled' => false,
);

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


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

$attributes = elgg_format_attributes($vars);

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