From db951f94b6ae60f899f719f17dce4aa6c47edf54 Mon Sep 17 00:00:00 2001 From: Kevin Jardine Date: Mon, 24 Oct 2011 12:08:24 +0200 Subject: now uses a date_local view to consistently display events in local server time --- views/default/event_calendar/input/date_local.php | 56 +++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 views/default/event_calendar/input/date_local.php (limited to 'views/default/event_calendar/input') diff --git a/views/default/event_calendar/input/date_local.php b/views/default/event_calendar/input/date_local.php new file mode 100644 index 000000000..f9979cb38 --- /dev/null +++ b/views/default/event_calendar/input/date_local.php @@ -0,0 +1,56 @@ + '', + 'disabled' => false, + 'timestamp' => false, +); + +$vars = array_merge($defaults, $vars); + +$timestamp = $vars['timestamp']; +unset($vars['timestamp']); + +if ($timestamp) { + echo elgg_view('input/hidden', array( + 'name' => $vars['name'], + 'value' => $vars['value'], + )); + + $vars['class'] = "{$vars['class']} elgg-input-timestamp"; + $vars['id'] = $vars['name']; + unset($vars['name']); + unset($vars['internalname']); +} + +// convert timestamps to text for display +if (is_numeric($vars['value'])) { + $vars['value'] = date('Y/m/d', $vars['value']); +} + +$attributes = elgg_format_attributes($vars); +echo ""; -- cgit v1.2.3