summaryrefslogtreecommitdiffstats
path: root/apps/tasks/js
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-04-20 22:56:59 +0200
committerBart Visscher <bartv@thisnet.nl>2012-04-20 22:56:59 +0200
commit3d68732657dee0e131bb54c6ca4c4052cce7ce2f (patch)
tree99adcd950471cad68ca787a0a00a0052f8c4f1b8 /apps/tasks/js
parent1384be4bff8544244c689ecb69e43ea09654416b (diff)
downloadnextcloud-server-3d68732657dee0e131bb54c6ca4c4052cce7ce2f.tar.gz
nextcloud-server-3d68732657dee0e131bb54c6ca4c4052cce7ce2f.zip
Tasks: Due date without time support added
Diffstat (limited to 'apps/tasks/js')
-rw-r--r--apps/tasks/js/tasks.js21
1 files changed, 14 insertions, 7 deletions
diff --git a/apps/tasks/js/tasks.js b/apps/tasks/js/tasks.js
index 9866250322d..684f671e41a 100644
--- a/apps/tasks/js/tasks.js
+++ b/apps/tasks/js/tasks.js
@@ -85,7 +85,9 @@ OC.Tasks = {
if (task.due){
var date = new Date(parseInt(task.due)*1000);
due.find('.date').datepicker('setDate', date);
- due.find('.time').timepicker('setTime', date.getHours()+':'+date.getMinutes());
+ if (!task.due_date_only) {
+ due.find('.time').timepicker('setTime', date.getHours()+':'+date.getMinutes());
+ }
}
$('<div>')
.addClass('more')
@@ -186,16 +188,21 @@ OC.Tasks = {
var $date = $(this).parent().children('.date');
var $time = $(this).parent().children('.time');
var date = $date.datepicker('getDate');
- var time = $time.timepicker('getTime').split(':');
- var due;
- if (!date || time.length<2){
+ var time = $time.val().split(':');
+ var due, date_only = false;
+ if (!date){
due = false;
} else {
- date.setHours(time[0]);
- date.setMinutes(time[1]);
+ if (time.length==2){
+ date.setHours(time[0]);
+ date.setMinutes(time[1]);
+ }
+ else {
+ date_only = true;
+ }
due = date.getTime()/1000;
}
- $.post('ajax/update_property.php', {id:task.id, type:'due', due:due}, function(jsondata){
+ $.post('ajax/update_property.php', {id:task.id, type:'due', due:due, date:date_only?1:0}, function(jsondata){
if(jsondata.status != 'success') {
task.due = old_due;
}