calendarui/editors/src/CalenEditorDataHandler.cpp
branchRCL_3
changeset 27 55d60436f00b
parent 0 f979ecb2b13e
child 67 1539a383d7b6
--- a/calendarui/editors/src/CalenEditorDataHandler.cpp	Tue Apr 27 16:36:22 2010 +0300
+++ b/calendarui/editors/src/CalenEditorDataHandler.cpp	Tue May 11 16:12:24 2010 +0300
@@ -790,7 +790,22 @@
         case ERepeatDaily:
         case ERepeatWorkdays:
             {
-            TTimeIntervalDays durDays = Edited().EndDateTime().DaysFrom( Edited().StartDateTime() );
+            TTime startDate = Edited().StartDateTime();
+            TTime endDate = Edited().EndDateTime();
+            // In case AllDay event end at "12:00am" 24/06/2009. 
+            // editor should display EndDate as 23/06/2009.
+            if(Edited().IsAllDayEvent())
+                {
+                if( endDate > startDate )
+                    {
+                    endDate -= TTimeIntervalDays( 1 );
+                    if( endDate < startDate )
+                        {
+                        endDate = startDate;
+                        }
+                    }
+                }
+            TTimeIntervalDays durDays = endDate.DaysFrom( startDate);
             isError = durDays >= TTimeIntervalDays(1);
             break;
             }