calendarui/commonutils/src/calendateutils.cpp
changeset 50 579cc610882e
parent 18 c198609911f9
child 55 2c54b51f39c4
--- a/calendarui/commonutils/src/calendateutils.cpp	Wed Jun 23 18:11:28 2010 +0300
+++ b/calendarui/commonutils/src/calendateutils.cpp	Tue Jul 06 14:14:56 2010 +0300
@@ -120,17 +120,6 @@
 // (other items were commented in a header).
 // -----------------------------------------------------------------------------
 //
- bool CalenDateUtils::isNullTime( QDateTime& time )
-    {
-    return( time.isNull() );
-    }
-
-// -----------------------------------------------------------------------------
-// ?classname::?member_function
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
  QDateTime CalenDateUtils::limitToValidTime( const QDateTime& time )
     {    
     QDateTime valid = time;
@@ -169,7 +158,7 @@
 //
  int CalenDateUtils::timeOfDay( const QDateTime& dateTime )
     {    
-    QDateTime midnight = CalenDateUtils::beginningOfDay( dateTime );
+    QDateTime midnight = beginningOfDay( dateTime );
     int resultInSec = midnight.secsTo(dateTime);
     
     return (resultInSec/60);
@@ -201,15 +190,7 @@
 //
  QDateTime CalenDateUtils::now()
     {
-    TTime currentTime;
-    currentTime.HomeTime();
-    TDateTime curDateTime = currentTime.DateTime();
-    QDateTime ret;
-    ret.setDate(QDate(curDateTime.Year(), curDateTime.Month() + 1, curDateTime.Day() + 1));
-    ret.setTime(QTime(curDateTime.Hour(), curDateTime.Minute(), curDateTime.Second(), curDateTime.MicroSecond()));
-    // TODO: need to use QDateTime::currentDateTime() from QT4.6 onwards
-    //return QDateTime::currentDateTime();
-    return ret;
+    return QDateTime::currentDateTime();
     }
 
 // -----------------------------------------------------------------------------
@@ -250,44 +231,6 @@
  // (other items were commented in a header).
  // -----------------------------------------------------------------------------
  //
- QDateTime CalenDateUtils::pastOf(const QDateTime& dateTime, int numOfDays)
-     {
-     QDateTime result;
-     int dayNumber = dateTime.date().day();
-      int numOfDaysInMonth = dayNumber;
-      int month = dateTime.date().month();
-      int year = dateTime.date().year();
-      int buff = numOfDays;
-      QDate date(year, month, dayNumber);
-      while(buff > numOfDaysInMonth)
-          {
-          if(month == 1) {
-          // If January,
-          month = 12; // December
-          year--;
-          }
-          else {
-          month--;
-          }
-          // Create the qdate with these details
-          date.setDate(year, month, 1);
-          // check to see if it goes beyond the next month also
-          buff = buff - numOfDaysInMonth;
-          numOfDaysInMonth = date.daysInMonth();
-          }
-      
-      // Substract buff days from end of the month
-      int day = numOfDaysInMonth - buff;
-      date.setYMD(date.year(), date.month(), day);
-      result.setDate(date);
-      result.setTime(dateTime.time());
-      return result;
-     }
- 
- // -----------------------------------------------------------------------------
- // (other items were commented in a header).
- // -----------------------------------------------------------------------------
- //
  QDateTime CalenDateUtils::futureOf(const QDateTime& dateTime, int numOfDays)
      {
      QDateTime result;