calendarui/commonutils/src/calenagendautils.cpp
changeset 57 bb2d3e476f29
parent 45 b6db4fd4947b
child 89 b57382753122
equal deleted inserted replaced
55:2c54b51f39c4 57:bb2d3e476f29
    48 
    48 
    49     TRACE_EXIT_POINT;
    49     TRACE_EXIT_POINT;
    50     return result;
    50     return result;
    51     }
    51     }
    52 
    52 
       
    53  // ---------------------------------------------------------------------------
       
    54  // CalenAgendaUtils::IsAllDayEvent
       
    55  // Allday event is an event  with a duration of n*24h.
       
    56  // ---------------------------------------------------------------------------
       
    57  //
       
    58  bool CalenAgendaUtils::isAlldayEvent( const AgendaEntry& entry )
       
    59      {
       
    60      
       
    61      TRACE_ENTRY_POINT;
       
    62 
       
    63      bool allDayEvent( false );
       
    64      if (AgendaEntry::TypeAppoinment == entry.type() ||
       
    65              AgendaEntry::TypeEvent == entry.type()) {    
       
    66          QDateTime startTime = entry.startTime();
       
    67          QDateTime stopTime  = entry.endTime();
       
    68      
       
    69          int differenceInDays = startTime.daysTo(stopTime);
       
    70          if( startTime != stopTime && 
       
    71                  startTime == CalenDateUtils::beginningOfDay( startTime ) && 
       
    72                  stopTime == CalenDateUtils::beginningOfDay( stopTime ) && 
       
    73                  differenceInDays >= 1 )
       
    74              {
       
    75              allDayEvent = true;
       
    76              }
       
    77          else
       
    78              {
       
    79              allDayEvent = false;
       
    80              }
       
    81      }
       
    82      
       
    83      TRACE_EXIT_POINT;
       
    84      return allDayEvent;
       
    85      }
       
    86 
    53 //  End of File
    87 //  End of File