meetingrequest/mrgui/src/cesmrmemotimevalidator.cpp
branchRCL_3
changeset 25 3533d4323edc
equal deleted inserted replaced
24:d189ee25cf9d 25:3533d4323edc
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  ESMR time and date sanity checks and saving
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "emailtrace.h"
       
    20 #include <eikmfne.h>
       
    21 #include <calentry.h>
       
    22 #include <e32std.h>
       
    23 #include "cesmrmemotimevalidator.h"
       
    24 #include "cesmrglobalnote.h"
       
    25 #include "mesmrfieldstorage.h"
       
    26 #include "mesmrcalentry.h"
       
    27 
       
    28 // Unnamed namespace for local definitions
       
    29 namespace {
       
    30 
       
    31 const TInt KMaxHours(23);
       
    32 const TInt KMaxMinutes(59);
       
    33 const TInt KMaxSeconds(59);
       
    34 
       
    35 // Definition fom max possible time
       
    36 #define KMaxTTime (TTime(TDateTime(2100, EDecember, 31-2, 23, 59, 59, 999999)))
       
    37 
       
    38 // Definition fom min possible time
       
    39 #define KMinTTime (TTime(TDateTime(1900, EJanuary, 2-1, 0, 0, 0, 0)))
       
    40 
       
    41 #ifdef _DEBUG
       
    42 
       
    43 // Literal for panics
       
    44 _LIT( KESMRMemoTimeValidator, "ESMRMemoTimeValidator" );
       
    45 
       
    46 /** Panic code definitions */
       
    47 enum TESMRMemoTimeValidator
       
    48     {
       
    49     /** Start date field not set */
       
    50     EESMRMemoValidatorNullStartDate,
       
    51     /** Stop date field not set */
       
    52     EESMRMemoValidatorNullStopDate,
       
    53     /** Relative alarm called for non-relative alarm event */
       
    54     EESMRMemoValidatorRelativeAlarm
       
    55     };
       
    56 
       
    57 /**
       
    58  * Raises system panic.
       
    59  * @param aPanic Panic code
       
    60  * @see TESMRRecurrentEditValidatorPanic
       
    61  */
       
    62 void Panic( TESMRMemoTimeValidator aPanic )
       
    63     {
       
    64     User::Panic( KESMRMemoTimeValidator, aPanic );
       
    65     }
       
    66 
       
    67 #endif // _DEBUG
       
    68 
       
    69 /**
       
    70  * Sets date to editor. Date is checked and adjusted
       
    71  * between min and max before setting
       
    72  * @param aEditor Reference to time editor
       
    73  * @param aDate On return contains the set date.
       
    74  */
       
    75 void SetDateToEditor(
       
    76         CEikDateEditor& aEditor,
       
    77         TTime& aDate )
       
    78     {
       
    79     if ( aDate < KMinTTime )
       
    80         {
       
    81         aDate = KMinTTime;
       
    82         }
       
    83     else if ( aDate > KMaxTTime )
       
    84         {
       
    85         aDate = KMaxTTime;
       
    86         }
       
    87 
       
    88     if ( aEditor.IsVisible() )
       
    89         {
       
    90         aEditor.SetDate( aDate );
       
    91         }
       
    92     }
       
    93 
       
    94 }//namespace
       
    95 
       
    96 // ======== MEMBER FUNCTIONS ========
       
    97 
       
    98 // ---------------------------------------------------------------------------
       
    99 // CESMRMemoTimeValidator::~CESMRMemoTimeValidator
       
   100 // ---------------------------------------------------------------------------
       
   101 //
       
   102 inline CESMRMemoTimeValidator::CESMRMemoTimeValidator( )
       
   103     {
       
   104     FUNC_LOG;
       
   105     // Do nothing
       
   106     }
       
   107 
       
   108 // ---------------------------------------------------------------------------
       
   109 // CESMRMemoTimeValidator::~CESMRMemoTimeValidator
       
   110 // ---------------------------------------------------------------------------
       
   111 //
       
   112 CESMRMemoTimeValidator::~CESMRMemoTimeValidator( )
       
   113     {
       
   114     FUNC_LOG;
       
   115     // Do nothing
       
   116     }
       
   117 
       
   118 // ---------------------------------------------------------------------------
       
   119 // CESMRMemoTimeValidator::NewL
       
   120 // ---------------------------------------------------------------------------
       
   121 //
       
   122 CESMRMemoTimeValidator* CESMRMemoTimeValidator::NewL( )
       
   123     {
       
   124     FUNC_LOG;
       
   125     CESMRMemoTimeValidator* self = new (ELeave) CESMRMemoTimeValidator();
       
   126     return self;
       
   127     }
       
   128 
       
   129 // ---------------------------------------------------------------------------
       
   130 // CESMRMemoTimeValidator::ValidateL
       
   131 // ---------------------------------------------------------------------------
       
   132 //
       
   133 MESMRFieldValidator::TESMRFieldValidatorError
       
   134         CESMRMemoTimeValidator::ValidateL( TBool aCorrectAutomatically )
       
   135     {
       
   136     FUNC_LOG;
       
   137     TTime start = StartDateTimeL();
       
   138     TTime end = EndDateTimeL();
       
   139 
       
   140     PreValidateEditorContent();
       
   141 
       
   142     if ( aCorrectAutomatically )
       
   143         {
       
   144         const CCalEntry& orginalEntry( iEntry->OriginalEntry() );
       
   145         if ( end < start )
       
   146             {
       
   147             if ( iEntry->IsStoredL() )
       
   148                 {
       
   149                 start = orginalEntry.StartTimeL().TimeLocalL();
       
   150                 end = orginalEntry.EndTimeL().TimeLocalL();
       
   151                 }
       
   152             else
       
   153                 {
       
   154                 end = start;
       
   155                 }
       
   156             }
       
   157 
       
   158         iCurrentStartTime = start;
       
   159         iCurrentEndTime = end;
       
   160 
       
   161         SetDateToEditor( *iStartDate, iCurrentStartTime );
       
   162         SetDateToEditor( *iEndDate, iCurrentEndTime );
       
   163         }
       
   164     else
       
   165         {
       
   166         if ( end < start )
       
   167             {
       
   168             return MESMRFieldValidator::EErrorEndEarlierThanStart;
       
   169             }
       
   170         }
       
   171 
       
   172     return MESMRFieldValidator::EErrorNone;
       
   173     }
       
   174 
       
   175 // ---------------------------------------------------------------------------
       
   176 // CESMRMemoTimeValidator::ReadValuesFromEntryL
       
   177 // ---------------------------------------------------------------------------
       
   178 //
       
   179 void CESMRMemoTimeValidator::ReadValuesFromEntryL(
       
   180         MESMRCalEntry& aEntry )
       
   181     {
       
   182     FUNC_LOG;
       
   183     if ( MESMRCalEntry::EESMRCalEntryMemo == aEntry.Type() )
       
   184         {
       
   185         __ASSERT_DEBUG( iStartDate, Panic( EESMRMemoValidatorNullStartDate) );
       
   186         __ASSERT_DEBUG( iEndDate, Panic( EESMRMemoValidatorNullStopDate) );
       
   187 
       
   188         iEntry = &aEntry;
       
   189         CCalEntry& entry( iEntry->Entry() );
       
   190 
       
   191         iCurrentStartTime = entry.StartTimeL().TimeLocalL();
       
   192         
       
   193         if ( aEntry.IsAllDayEventL() )
       
   194             {
       
   195             // if the event is allday event, previous day for end date will be
       
   196             // shown in UI. See Outlook for reference...
       
   197             iCurrentEndTime = iCurrentStartTime;
       
   198             }
       
   199         else
       
   200             {
       
   201             iCurrentEndTime = entry.EndTimeL().TimeLocalL();            
       
   202             }
       
   203 
       
   204         SetDateToEditor( *iStartDate, iCurrentStartTime );
       
   205         SetDateToEditor( *iEndDate, iCurrentEndTime );
       
   206 
       
   207         DrawEditorsDeferred();
       
   208         }
       
   209     }
       
   210 
       
   211 // ---------------------------------------------------------------------------
       
   212 // CESMRMemoTimeValidator::StoreValuesToEntryL
       
   213 // ---------------------------------------------------------------------------
       
   214 //
       
   215 void CESMRMemoTimeValidator::StoreValuesToEntryL(
       
   216         MESMRCalEntry& aEntry )
       
   217     {
       
   218     FUNC_LOG;
       
   219     if ( MESMRCalEntry::EESMRCalEntryMemo == aEntry.Type() )
       
   220         {
       
   221         PreValidateEditorContent();
       
   222 
       
   223         CCalEntry& entry( aEntry.Entry() );
       
   224         const CCalEntry& originalEntry( aEntry.OriginalEntry() );
       
   225         
       
   226         TTime start = StartDateTimeL();
       
   227         TTime end = EndDateTimeL();
       
   228 
       
   229         if ( end < start )
       
   230             {
       
   231             User::Leave( KErrArgument );
       
   232             }
       
   233 
       
   234         TTime orgStartTime = originalEntry.StartTimeL().TimeLocalL();
       
   235         TTime orgEndTime   = originalEntry.EndTimeL().TimeLocalL();
       
   236 
       
   237         if( orgStartTime != start || orgEndTime != end )
       
   238             {
       
   239             TCalTime startTime;
       
   240             TCalTime endTime;
       
   241     
       
   242             // The default mode for memo is EFloating,
       
   243             // But some 3rd party application might have saved a different type
       
   244             // for one reason or another. In that case we are using
       
   245             // the existing value.
       
   246             if ( aEntry.IsStoredL() )
       
   247                 {
       
   248                 TCalTime::TTimeMode timeMode =
       
   249                             aEntry.Entry().StartTimeL().TimeMode();
       
   250     
       
   251                 switch ( timeMode )
       
   252                     {
       
   253                     case TCalTime::EFixedUtc:
       
   254                         {
       
   255                         startTime.SetTimeUtcL( start );
       
   256                         endTime.SetTimeUtcL( end );
       
   257                         break;
       
   258                         }
       
   259                     case TCalTime::EFixedTimeZone:
       
   260                         {
       
   261                         startTime.SetTimeLocalL( start );
       
   262                         endTime.SetTimeLocalL( end );
       
   263                         break;
       
   264                         }
       
   265                     case TCalTime::EFloating: // Fall through
       
   266                     default:
       
   267                         {
       
   268                         startTime.SetTimeLocalFloatingL( start );
       
   269                         endTime.SetTimeLocalFloatingL( end );
       
   270                         break;
       
   271                         }
       
   272                     }
       
   273                 }
       
   274             else
       
   275                 {
       
   276                 startTime.SetTimeLocalFloatingL( start );
       
   277                 endTime.SetTimeLocalFloatingL( end );
       
   278                 }
       
   279     
       
   280             entry.SetStartAndEndTimeL( startTime, endTime );
       
   281             }
       
   282         }
       
   283     }
       
   284 
       
   285 // ---------------------------------------------------------------------------
       
   286 // CESMRMemoTimeValidator::SetStartTimeFieldL
       
   287 // ---------------------------------------------------------------------------
       
   288 //
       
   289 void CESMRMemoTimeValidator::SetStartTimeFieldL(
       
   290         CEikTimeEditor& /*aStartTime*/ )
       
   291     {
       
   292     FUNC_LOG;
       
   293     // No implementation for memo
       
   294     }
       
   295 
       
   296 // ---------------------------------------------------------------------------
       
   297 // CESMRMemoTimeValidator::SetEndTimeFieldL
       
   298 // ---------------------------------------------------------------------------
       
   299 //
       
   300 void CESMRMemoTimeValidator::SetEndTimeFieldL(
       
   301         CEikTimeEditor& /*aEndTime*/ )
       
   302     {
       
   303     FUNC_LOG;
       
   304     // No implementation for memo
       
   305     }
       
   306 
       
   307 // ---------------------------------------------------------------------------
       
   308 // CESMRMemoTimeValidator::SetStartDateFieldL
       
   309 // ---------------------------------------------------------------------------
       
   310 //
       
   311 void CESMRMemoTimeValidator::SetStartDateFieldL(
       
   312         CEikDateEditor& aStartDate )
       
   313     {
       
   314     FUNC_LOG;
       
   315     iStartDate = &aStartDate;
       
   316     
       
   317     if ( Time::NullTTime() != iCurrentStartTime )
       
   318         {
       
   319         SetDateToEditor( *iStartDate, iCurrentStartTime );
       
   320         }    
       
   321     }
       
   322 
       
   323 // ---------------------------------------------------------------------------
       
   324 // CESMRMemoTimeValidator::SetEndDateFieldL
       
   325 // ---------------------------------------------------------------------------
       
   326 //
       
   327 void CESMRMemoTimeValidator::SetEndDateFieldL(
       
   328         CEikDateEditor& aEndDate )
       
   329     {
       
   330     FUNC_LOG;
       
   331     iEndDate = &aEndDate;
       
   332     
       
   333     if ( Time::NullTTime() != iCurrentEndTime )
       
   334         {
       
   335         SetDateToEditor( *iEndDate, iCurrentEndTime );
       
   336         } 
       
   337     }
       
   338 
       
   339 // ---------------------------------------------------------------------------
       
   340 // CESMRMemoTimeValidator::SetAlarmTimeFieldL
       
   341 // ---------------------------------------------------------------------------
       
   342 //
       
   343 void CESMRMemoTimeValidator::SetAlarmTimeFieldL(
       
   344         CEikTimeEditor& /*aAlarmTime*/ )
       
   345     {
       
   346     FUNC_LOG;
       
   347     // No implementation for memo
       
   348     }
       
   349 
       
   350 // ---------------------------------------------------------------------------
       
   351 // CESMRMemoTimeValidator::SetAlarmDateFieldL
       
   352 // ---------------------------------------------------------------------------
       
   353 //
       
   354 void CESMRMemoTimeValidator::SetAlarmDateFieldL(
       
   355         CEikDateEditor& /*aAlarmDate*/ )
       
   356     {
       
   357     FUNC_LOG;
       
   358     // No implementation for memo
       
   359     }
       
   360 
       
   361 // ---------------------------------------------------------------------------
       
   362 // CESMRMemoTimeValidator::SetRecurrenceUntilDateFieldL
       
   363 // ---------------------------------------------------------------------------
       
   364 //
       
   365 void CESMRMemoTimeValidator::SetRecurrenceUntilDateFieldL(
       
   366             CEikDateEditor& /*aRecurrenceUntil*/ )
       
   367     {
       
   368     FUNC_LOG;
       
   369     // No implementation for memo
       
   370     }
       
   371 
       
   372 // ---------------------------------------------------------------------------
       
   373 // CESMRMemoTimeValidator::SetAbsoluteAlarmOnOffFieldL
       
   374 // ---------------------------------------------------------------------------
       
   375 //
       
   376 void CESMRMemoTimeValidator::SetAbsoluteAlarmOnOffFieldL( 
       
   377         MMRAbsoluteAlarmController& /*aAbsoluteAlarmController*/ )
       
   378     {
       
   379     FUNC_LOG;
       
   380     // No implementation for memo
       
   381     }
       
   382 
       
   383 // ---------------------------------------------------------------------------
       
   384 // CESMRMemoTimeValidator::StartTimeChangedL
       
   385 // ---------------------------------------------------------------------------
       
   386 //
       
   387 void CESMRMemoTimeValidator::StartTimeChangedL()
       
   388     {
       
   389     FUNC_LOG;
       
   390     StartDateChandedL();
       
   391     }
       
   392 
       
   393 // ---------------------------------------------------------------------------
       
   394 // CESMRMemoTimeValidator::EndTimeChangedL
       
   395 // ---------------------------------------------------------------------------
       
   396 //
       
   397 void CESMRMemoTimeValidator::EndTimeChangedL()
       
   398     {
       
   399     FUNC_LOG;
       
   400     EndDateChangedL();
       
   401     }
       
   402 
       
   403 // ---------------------------------------------------------------------------
       
   404 // CESMRMemoTimeValidator::StartDateChandedL
       
   405 // ---------------------------------------------------------------------------
       
   406 //
       
   407 void CESMRMemoTimeValidator::StartDateChandedL()
       
   408     {
       
   409     FUNC_LOG;
       
   410     PreValidateEditorContent();
       
   411 
       
   412     TTime start = StartDateTimeL();
       
   413     TTime end = EndDateTimeL();
       
   414 
       
   415     TTimeIntervalMinutes diff;
       
   416     start.MinutesFrom( iCurrentStartTime, diff );
       
   417 
       
   418     end += diff;
       
   419 
       
   420     iCurrentStartTime = start;
       
   421     iCurrentEndTime = end;
       
   422 
       
   423     SetDateToEditor( *iStartDate, iCurrentStartTime );
       
   424     SetDateToEditor( *iEndDate, iCurrentEndTime );
       
   425 
       
   426     DrawEditorsDeferred();
       
   427     }
       
   428 
       
   429 // ---------------------------------------------------------------------------
       
   430 // CESMRMemoTimeValidator::EndDateChangedL
       
   431 // ---------------------------------------------------------------------------
       
   432 //
       
   433 void CESMRMemoTimeValidator::EndDateChangedL()
       
   434     {
       
   435     FUNC_LOG;
       
   436     TInt err( KErrNone );
       
   437 
       
   438     PreValidateEditorContent();
       
   439 
       
   440     TTime start = StartDateTimeL();
       
   441     TTime end = EndDateTimeL();
       
   442 
       
   443     if ( end < start )
       
   444         {
       
   445         err = KErrArgument;
       
   446         }
       
   447     else
       
   448         {
       
   449         iCurrentEndTime = end;
       
   450         }
       
   451 
       
   452     SetDateToEditor( *iStartDate, iCurrentStartTime );
       
   453     SetDateToEditor( *iEndDate, iCurrentEndTime );
       
   454 
       
   455     DrawEditorsDeferred();
       
   456 
       
   457     User::LeaveIfError( err );
       
   458     }
       
   459 
       
   460 // ---------------------------------------------------------------------------
       
   461 // CESMRMemoTimeValidator::AlarmTimeChangedL
       
   462 // ---------------------------------------------------------------------------
       
   463 //
       
   464 void CESMRMemoTimeValidator::AlarmTimeChangedL()
       
   465     {
       
   466     FUNC_LOG;
       
   467     // No implementation for memo
       
   468     }
       
   469 
       
   470 // ---------------------------------------------------------------------------
       
   471 // CESMRMemoTimeValidator::AlarmDateChangedL
       
   472 // ---------------------------------------------------------------------------
       
   473 //
       
   474 void CESMRMemoTimeValidator::AlarmDateChangedL()
       
   475     {
       
   476     FUNC_LOG;
       
   477     // No implementation for memo
       
   478     }
       
   479 
       
   480 // ---------------------------------------------------------------------------
       
   481 // CESMRMemoTimeValidator::RelativeAlarmChangedL
       
   482 // ---------------------------------------------------------------------------
       
   483 //
       
   484 void CESMRMemoTimeValidator::RelativeAlarmChangedL(
       
   485         TTimeIntervalMinutes /*aCurrentAlarmTimeOffset*/,
       
   486         TBool /*aHandleAlarmChange*/,
       
   487         TBool& /*aRelativeAlarmValid*/ )
       
   488     {
       
   489     FUNC_LOG;
       
   490     // No implementation for memo
       
   491     }
       
   492 
       
   493 // ---------------------------------------------------------------------------
       
   494 // CESMRMemoTimeValidator::SetAllDayEventL
       
   495 // ---------------------------------------------------------------------------
       
   496 //
       
   497 void CESMRMemoTimeValidator::SetAllDayEventL(
       
   498         TBool /*aAlldayEvent*/ )
       
   499     {
       
   500     FUNC_LOG;
       
   501     // No implementation for memo
       
   502     }
       
   503 
       
   504 // ---------------------------------------------------------------------------
       
   505 // CESMRMemoTimeValidator::SetAlarmOnOffL
       
   506 // ---------------------------------------------------------------------------
       
   507 //
       
   508 void CESMRMemoTimeValidator::SetAlarmOnOffL(
       
   509         TBool /*aAlarmOn*/ )
       
   510     {
       
   511     FUNC_LOG;
       
   512     // No implementation for memo
       
   513     }
       
   514 
       
   515 // ---------------------------------------------------------------------------
       
   516 // CESMRMemoTimeValidator::RecurrenceChangedL
       
   517 // ---------------------------------------------------------------------------
       
   518 //
       
   519 void CESMRMemoTimeValidator::RecurrenceChangedL(
       
   520         TESMRRecurrenceValue /*aRecurrence*/ )
       
   521     {
       
   522     FUNC_LOG;
       
   523     // No implementation for memo
       
   524     }
       
   525 
       
   526 // ---------------------------------------------------------------------------
       
   527 // CESMRMemoTimeValidator::RecurrenceEndDateChangedL
       
   528 // ---------------------------------------------------------------------------
       
   529 //
       
   530 void CESMRMemoTimeValidator::RecurrenceEndDateChangedL()
       
   531     {
       
   532     FUNC_LOG;
       
   533     // No implementation for memo
       
   534     }
       
   535 
       
   536 // ---------------------------------------------------------------------------
       
   537 // CESMRMemoTimeValidator::IsRelativeAlarmValid
       
   538 // ---------------------------------------------------------------------------
       
   539 //
       
   540 TBool CESMRMemoTimeValidator::IsRelativeAlarmValid(
       
   541 		TTimeIntervalMinutes /*aAlarmTimeOffset*/ )
       
   542     {
       
   543     FUNC_LOG;
       
   544     __ASSERT_DEBUG( ETrue, Panic( EESMRMemoValidatorRelativeAlarm ) );
       
   545     return EFalse;
       
   546     }
       
   547 
       
   548 // ---------------------------------------------------------------------------
       
   549 // CESMRMemoTimeValidator::PreValidateEditorContent
       
   550 // ---------------------------------------------------------------------------
       
   551 //
       
   552 TInt CESMRMemoTimeValidator::PreValidateEditorContent()
       
   553     {
       
   554     FUNC_LOG;
       
   555     TInt err( KErrNone );
       
   556     TRAP( err, PreValidateEditorContentL() );
       
   557     return err;
       
   558     }
       
   559 
       
   560 // ---------------------------------------------------------------------------
       
   561 // CESMRMemoTimeValidator::PreValidateEditorContentL
       
   562 // ---------------------------------------------------------------------------
       
   563 //
       
   564 void CESMRMemoTimeValidator::PreValidateEditorContentL()
       
   565     {
       
   566     FUNC_LOG;
       
   567     if ( iStartDate && iStartDate->IsVisible() )
       
   568         {
       
   569         iStartDate->PrepareForFocusLossL();
       
   570         }
       
   571 
       
   572     if ( iEndDate && iEndDate->IsVisible() )
       
   573         {
       
   574         iEndDate->PrepareForFocusLossL();
       
   575         }
       
   576     }
       
   577 
       
   578 // ---------------------------------------------------------------------------
       
   579 // CESMRMemoTimeValidator::DrawEditorsDeferred
       
   580 // ---------------------------------------------------------------------------
       
   581 //
       
   582 void CESMRMemoTimeValidator::DrawEditorsDeferred()
       
   583     {
       
   584     FUNC_LOG;
       
   585     if ( iStartDate && iStartDate->IsVisible() )
       
   586         {
       
   587         iStartDate->DrawDeferred();
       
   588         }
       
   589 
       
   590     if ( iEndDate && iEndDate->IsVisible() )
       
   591         {
       
   592         iEndDate->DrawDeferred();
       
   593         }
       
   594     }
       
   595 
       
   596 // ---------------------------------------------------------------------------
       
   597 // CESMRMemoTimeValidator::StartDateTimeL
       
   598 // ---------------------------------------------------------------------------
       
   599 //
       
   600 TDateTime CESMRMemoTimeValidator::StartDateTimeL()
       
   601     {
       
   602     FUNC_LOG;
       
   603     return iStartDate->Date().DateTime();
       
   604     }
       
   605 
       
   606 // ---------------------------------------------------------------------------
       
   607 // CESMRMemoTimeValidator::EndDateTimeL
       
   608 // ---------------------------------------------------------------------------
       
   609 //
       
   610 TDateTime CESMRMemoTimeValidator::EndDateTimeL()
       
   611     {
       
   612     FUNC_LOG;
       
   613     TDateTime endTime = iEndDate->Date().DateTime();
       
   614     // these need to be set; calendar views does not show
       
   615     // the memo for last date if end date is set different
       
   616     // from start date.
       
   617 
       
   618     endTime.SetHour(KMaxHours);
       
   619     endTime.SetMinute(KMaxMinutes);
       
   620     endTime.SetSecond(KMaxSeconds);
       
   621 
       
   622     return endTime;
       
   623     }
       
   624 
       
   625 // EOF
       
   626