summaryrefslogtreecommitdiffabout
path: root/libkcal/event.cpp
Side-by-side diff
Diffstat (limited to 'libkcal/event.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkcal/event.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/libkcal/event.cpp b/libkcal/event.cpp
index 5285559..ad66639 100644
--- a/libkcal/event.cpp
+++ b/libkcal/event.cpp
@@ -171,6 +171,26 @@ void Event::setDuration(int seconds)
setHasEndDate(false);
Incidence::setDuration(seconds);
}
+bool Event::matchTime(QDateTime*startDT, QDateTime* endDT)
+{
+ if ( ! doesRecur() ) {
+ if ( doesFloat() ) {
+ if ( mDtEnd.addDays( 1 ) < *startDT)
+ return false;
+ if ( endDT && mDtStart > * endDT)
+ return false;
+ } else {
+ if ( mDtEnd < *startDT )
+ return false;
+ if ( endDT && mDtStart > * endDT)
+ return false;
+ }
+ } else {
+ if ( endDT && mDtStart > * endDT)
+ return false;
+ }
+ return true;
+}
bool Event::isOverlapping ( Event* testEvent, QDateTime* overlapDT, QDateTime* startDT )
{
if ( testEvent == this )