summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
Unidiff
Diffstat (limited to 'korganizer/koagendaview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 13d8398..4ff6899 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -1001,3 +1001,16 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type)
1001 } else if ( item->incidence()->type() == "Todo" ) { 1001 } else if ( item->incidence()->type() == "Todo" ) {
1002 (static_cast<Todo*>(item->incidence()))->setDtDue(endDt); 1002 Todo* to = static_cast<Todo*>(item->incidence());
1003
1004 int len = 0;
1005 if ( to->hasStartDate() && to->hasDueDate() )
1006 len = to->dtStart().secsTo( to->dtDue());
1007 to->setDtDue(endDt);
1008 if ( to->hasStartDate() ) {
1009 if ( len>0 )
1010 to->setDtStart(to->dtDue().addSecs( -len ));
1011 else
1012 if (to->dtStart() > to->dtDue() )
1013 to->setDtStart(to->dtDue().addDays( -3 ));
1014 }
1015
1003 } 1016 }
@@ -1182,3 +1195,3 @@ void KOAgendaView::fillAgenda()
1182 if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date 1195 if ( ! todo->hasDueDate() && !todo->hasCompletedDate()) continue; // todo shall not be displayed if it has no date
1183 1196
1184 // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue. 1197 // ToDo items shall be displayed for the day they are due, but only showed today if they are already overdue.