From 1150f289dfb488cc0aaf9f1ae56183e752226312 Mon Sep 17 00:00:00 2001 From: Kevin Jardine Date: Tue, 13 Mar 2012 16:40:49 +0100 Subject: replaced deprecated friendly time, dates now stored properly in GMT and displayed in server time, added beginning of full calendar option --- .../default/event_calendar/full_calendar_view.php | 46 ++++++++++++++++++++++ views/default/event_calendar/input/date_local.php | 2 +- views/default/event_calendar/show_events.php | 6 ++- views/default/event_calendar/strapline.php | 2 +- 4 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 views/default/event_calendar/full_calendar_view.php (limited to 'views/default/event_calendar') diff --git a/views/default/event_calendar/full_calendar_view.php b/views/default/event_calendar/full_calendar_view.php new file mode 100644 index 000000000..b6c725908 --- /dev/null +++ b/views/default/event_calendar/full_calendar_view.php @@ -0,0 +1,46 @@ + $e->guid, + 'title' => $e->title, + 'start_date' => $e->start_date, + 'end_date' => $e->real_end_time, + ); +} + +$json_events_string = json_encode($event_array); + +// TODO: is there an easy way to avoid embedding JS? +?> + +
\ No newline at end of file diff --git a/views/default/event_calendar/input/date_local.php b/views/default/event_calendar/input/date_local.php index f9979cb38..f4cb48d11 100644 --- a/views/default/event_calendar/input/date_local.php +++ b/views/default/event_calendar/input/date_local.php @@ -49,7 +49,7 @@ if ($timestamp) { // convert timestamps to text for display if (is_numeric($vars['value'])) { - $vars['value'] = date('Y/m/d', $vars['value']); + $vars['value'] = date('Y-m-d', $vars['value']); } $attributes = elgg_format_attributes($vars); diff --git a/views/default/event_calendar/show_events.php b/views/default/event_calendar/show_events.php index b51b1c05f..63d722247 100644 --- a/views/default/event_calendar/show_events.php +++ b/views/default/event_calendar/show_events.php @@ -5,7 +5,7 @@ * @package event_calendar * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 * @author Kevin Jardine - * @copyright Radagast Solutions 2008 + * @copyright Radagast Solutions 2008-12 * @link http://radagast.biz/ * */ @@ -17,6 +17,8 @@ if ($vars['events']) { $event_list = elgg_view('event_calendar/agenda_view',$vars); } else if ($listing_format == 'paged') { $event_list = elgg_view('event_calendar/paged_view',$vars); + } else if ($listing_format == 'full') { + $event_list = elgg_view('event_calendar/full_calendar_view',$vars); } else { $options = array( 'list_class' => 'elgg-list-entity', @@ -32,7 +34,7 @@ if ($vars['events']) { } else { $event_list = '

'.elgg_echo('event_calendar:no_events_found').'

'; } -if ($listing_format == 'paged') { +if ($listing_format == 'paged' || $listing_format == 'full') { echo $event_list; } else { ?> diff --git a/views/default/event_calendar/strapline.php b/views/default/event_calendar/strapline.php index 15c7c98d9..edc60aa3e 100644 --- a/views/default/event_calendar/strapline.php +++ b/views/default/event_calendar/strapline.php @@ -9,7 +9,7 @@ $owner = get_entity($owner_guid); echo sprintf(elgg_echo('event_calendar:strapline'), - friendly_time($time_updated), + elgg_view_friendly_time($time_updated), "getURL() . "\">" . $owner->name ."" ); -- cgit v1.2.3