summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xapps/calendar/ajax/events.php9
-rw-r--r--apps/calendar/appinfo/app.php46
2 files changed, 29 insertions, 26 deletions
diff --git a/apps/calendar/ajax/events.php b/apps/calendar/ajax/events.php
index a912889f292..922df90b76b 100755
--- a/apps/calendar/ajax/events.php
+++ b/apps/calendar/ajax/events.php
@@ -27,8 +27,13 @@ function create_return_event($event, $vevent){
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('calendar');
-$start = DateTime::createFromFormat('U', $_GET['start']);
-$end = DateTime::createFromFormat('U', $_GET['end']);
+if(version_compare(PHP_VERSION, '5.3.0', '>=')){
+ $start = DateTime::createFromFormat('U', $_GET['start']);
+ $end = DateTime::createFromFormat('U', $_GET['end']);
+}else{
+ $start = new DateTime('@' . $_GET['start']);
+ $end = new DateTime('@' . $_GET['end']);
+}
$calendar_id = $_GET['calendar_id'];
if (is_numeric($calendar_id)) {
diff --git a/apps/calendar/appinfo/app.php b/apps/calendar/appinfo/app.php
index 0968737219a..f297c4d16d4 100644
--- a/apps/calendar/appinfo/app.php
+++ b/apps/calendar/appinfo/app.php
@@ -1,25 +1,23 @@
<?php
-if(version_compare(PHP_VERSION, '5.3.0', '>=')){
- $l=new OC_L10N('calendar');
- OC::$CLASSPATH['OC_Calendar_App'] = 'apps/calendar/lib/app.php';
- OC::$CLASSPATH['OC_Calendar_Calendar'] = 'apps/calendar/lib/calendar.php';
- OC::$CLASSPATH['OC_Calendar_Object'] = 'apps/calendar/lib/object.php';
- OC::$CLASSPATH['OC_Calendar_Hooks'] = 'apps/calendar/lib/hooks.php';
- OC::$CLASSPATH['OC_Connector_Sabre_CalDAV'] = 'apps/calendar/lib/connector_sabre.php';
- OC::$CLASSPATH['OC_Search_Provider_Calendar'] = 'apps/calendar/lib/search.php';
- OC_HOOK::connect('OC_User', 'post_deleteUser', 'OC_Calendar_Hooks', 'deleteUser');
- OC_Hook::connect('OC_DAV', 'initialize', 'OC_Calendar_Hooks', 'initializeCalDAV');
- OC_Util::addScript('calendar','loader');
- OC_App::register( array(
- 'order' => 10,
- 'id' => 'calendar',
- 'name' => 'Calendar' ));
- OC_App::addNavigationEntry( array(
- 'id' => 'calendar_index',
- 'order' => 10,
- 'href' => OC_Helper::linkTo( 'calendar', 'index.php' ),
- 'icon' => OC_Helper::imagePath( 'calendar', 'icon.svg' ),
- 'name' => $l->t('Calendar')));
- OC_App::registerPersonal('calendar', 'settings');
- OC_Search::registerProvider('OC_Search_Provider_Calendar');
-}
+$l=new OC_L10N('calendar');
+OC::$CLASSPATH['OC_Calendar_App'] = 'apps/calendar/lib/app.php';
+OC::$CLASSPATH['OC_Calendar_Calendar'] = 'apps/calendar/lib/calendar.php';
+OC::$CLASSPATH['OC_Calendar_Object'] = 'apps/calendar/lib/object.php';
+OC::$CLASSPATH['OC_Calendar_Hooks'] = 'apps/calendar/lib/hooks.php';
+OC::$CLASSPATH['OC_Connector_Sabre_CalDAV'] = 'apps/calendar/lib/connector_sabre.php';
+OC::$CLASSPATH['OC_Search_Provider_Calendar'] = 'apps/calendar/lib/search.php';
+OC_HOOK::connect('OC_User', 'post_deleteUser', 'OC_Calendar_Hooks', 'deleteUser');
+OC_Hook::connect('OC_DAV', 'initialize', 'OC_Calendar_Hooks', 'initializeCalDAV');
+OC_Util::addScript('calendar','loader');
+OC_App::register( array(
+ 'order' => 10,
+ 'id' => 'calendar',
+ 'name' => 'Calendar' ));
+OC_App::addNavigationEntry( array(
+ 'id' => 'calendar_index',
+ 'order' => 10,
+ 'href' => OC_Helper::linkTo( 'calendar', 'index.php' ),
+ 'icon' => OC_Helper::imagePath( 'calendar', 'icon.svg' ),
+ 'name' => $l->t('Calendar')));
+OC_App::registerPersonal('calendar', 'settings');
+OC_Search::registerProvider('OC_Search_Provider_Calendar'); \ No newline at end of file