aboutsummaryrefslogtreecommitdiff
path: root/models
diff options
context:
space:
mode:
authorKevin Jardine <kevinjardine@yahoo.com>2012-03-13 16:40:49 +0100
committerKevin Jardine <kevinjardine@yahoo.com>2012-03-13 16:40:49 +0100
commit1150f289dfb488cc0aaf9f1ae56183e752226312 (patch)
tree17771e41eba4eef5ddc04c2bef79babfd46ff09c /models
parente0e9ff33a7f5fc334af8127fc8680925ce967d14 (diff)
downloadelgg-1150f289dfb488cc0aaf9f1ae56183e752226312.tar.gz
elgg-1150f289dfb488cc0aaf9f1ae56183e752226312.tar.bz2
replaced deprecated friendly time, dates now stored properly in GMT and displayed in server time, added beginning of full calendar option
Diffstat (limited to 'models')
-rw-r--r--models/model.php12
1 files changed, 10 insertions, 2 deletions
diff --git a/models/model.php b/models/model.php
index 66091ba67..76d2d7b61 100644
--- a/models/model.php
+++ b/models/model.php
@@ -78,7 +78,11 @@ function event_calendar_set_event_from_form($event_guid,$group_guid) {
$event->title = get_input('title');
$event->description = get_input('description');
$event->venue = get_input('venue');
- $event->start_date = get_input('start_date');
+ // convert start date from current server time to GMT
+ $start_date = get_input('start_date');
+ $start_date_text = date("Y-m-d",$start_date);
+
+ $event->start_date = strtotime($start_date_text." ".date_default_timezone_get());
$event->end_date = get_input('end_date','');
if ($event_calendar_times == 'yes') {
@@ -881,6 +885,10 @@ function event_calendar_format_time($date,$time1,$time2='') {
}
}
+function event_calender_get_gmt_from_server_time($server_time) {
+ $gmtime = $server_time - (int)substr(date('O'),0,3)*60*60;
+}
+
function event_calendar_activated_for_group($group) {
$group_calendar = elgg_get_plugin_setting('group_calendar', 'event_calendar');
$group_default = elgg_get_plugin_setting('group_default', 'event_calendar');
@@ -953,7 +961,7 @@ function event_calendar_get_formatted_full_items($event) {
function event_calendar_get_formatted_time($event) {
$date_format = 'j M Y';
- $event_calendar_times = elgg_get_plugin_setting('times', 'event_calendar');
+ $event_calendar_times = elgg_get_plugin_setting('times', 'event_calendar') == 'yes';
$start_date = date($date_format,$event->start_date);
if ((!$event->end_date) || ($event->end_date == $event->start_date)) {