diff --git a/apps/tasks/ajax/update_property.php b/apps/tasks/ajax/update_property.php index 1916a2eb7b..66ff34f848 100644 --- a/apps/tasks/ajax/update_property.php +++ b/apps/tasks/ajax/update_property.php @@ -21,6 +21,21 @@ switch($property) { $summary = $_POST['summary']; $vtodo->setString('SUMMARY', $summary); break; + case 'due': + $due = $_POST['due']; + if ($due != 'false') { + try { + $timezone = OC_Preferences::getValue(OC_User::getUser(), 'calendar', 'timezone', date_default_timezone_get()); + $timezone = new DateTimeZone($timezone); + $due = new DateTime('@'.$due); + $due->setTimezone($timezone); + } catch (Exception $e) { + OC_JSON::error(array('data'=>array('message'=>OC_Task_App::$l10n->t('Invalid date/time')))); + exit(); + } + } + $vtodo->setDateTime('DUE', $due); + break; case 'complete': $checked = $_POST['checked']; OC_Task_App::setComplete($vtodo, $checked ? '100' : '0', null); diff --git a/apps/tasks/css/style.css b/apps/tasks/css/style.css index 9185c52f77..084085d6b7 100644 --- a/apps/tasks/css/style.css +++ b/apps/tasks/css/style.css @@ -53,3 +53,6 @@ .task .more{display:none;} .task .description{position:relative;left:4em;} +.task .due{position:absolute;right:0.3em;} +.task .due .date{width:6em;} +.task .due .time{width:6em;} diff --git a/apps/tasks/index.php b/apps/tasks/index.php index 95bb10a77c..1ec91feb17 100644 --- a/apps/tasks/index.php +++ b/apps/tasks/index.php @@ -18,6 +18,8 @@ if( count($calendars) == 0 ) { exit; } +OC_Util::addScript('3rdparty/timepicker', 'jquery.ui.timepicker'); +OC_Util::addStyle('3rdparty/timepicker', 'jquery.ui.timepicker'); OC_UTIL::addScript('tasks', 'tasks'); OC_UTIL::addStyle('tasks', 'style'); OC_Util::addScript('contacts','jquery.multi-autocomplete'); diff --git a/apps/tasks/js/tasks.js b/apps/tasks/js/tasks.js index 1381a356fb..8d2714941d 100644 --- a/apps/tasks/js/tasks.js +++ b/apps/tasks/js/tasks.js @@ -65,9 +65,32 @@ OC.Tasks = { var description = $('