author | harlekin <harlekin> | 2002-11-27 14:19:09 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-11-27 14:19:09 (UTC) |
commit | 5f0c90d4b6972c1ad22ba20b45cd1d3f88298099 (patch) (side-by-side diff) | |
tree | 0cd24ab2ff259a76e06d7940b9de03a2b067d57a /core/pim/today/plugins/datebook/datebookevent.cpp | |
parent | a75b95fd9f89fc80e867c0efb5837178cab56cbb (diff) | |
download | opie-5f0c90d4b6972c1ad22ba20b45cd1d3f88298099.zip opie-5f0c90d4b6972c1ad22ba20b45cd1d3f88298099.tar.gz opie-5f0c90d4b6972c1ad22ba20b45cd1d3f88298099.tar.bz2 |
ability to show next days too added
Diffstat (limited to 'core/pim/today/plugins/datebook/datebookevent.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/today/plugins/datebook/datebookevent.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/core/pim/today/plugins/datebook/datebookevent.cpp b/core/pim/today/plugins/datebook/datebookevent.cpp index 0a0d186..8277529 100644 --- a/core/pim/today/plugins/datebook/datebookevent.cpp +++ b/core/pim/today/plugins/datebook/datebookevent.cpp @@ -59,5 +59,8 @@ DateBookEvent::DateBookEvent(const EffectiveEvent &ev, // start time of event - msg += "<br>" + ampmTime(QTime( (ev).event().start().time() ) ) + QDate tempDate = (ev).event().start().date(); + msg += "<br>" + + ampmTime( QTime( (ev).event().start().time() ) ) // end time of event - + "<b> - </b>" + ampmTime(QTime( (ev).event().end().time() ) ); + + "<b> - </b>" + ampmTime( QTime( (ev).event().end().time() ) ) + + differDate( tempDate ); } @@ -97,2 +100,19 @@ QString DateBookEvent::ampmTime( QTime tm ) { +QString DateBookEvent::differDate( QDate date ) { + QDate currentDate = QDate::currentDate(); + QString returnText = "<font color = #407DD9><b> "; + int differDate = currentDate.daysTo( date ); + if ( currentDate.dayOfWeek() == date.dayOfWeek() ) { + returnText += "" ; + // not working right for recurring events + //} else if ( differDate == 1 ) { + //returnText += tr( "tomorrow" ); + } else { + //returnText += tr( "in %1 days" ).arg( differDate ); + returnText += " [ " + date.dayName( date.dayOfWeek() ) + " ] "; + } + returnText += "</b></font>"; + return returnText; +} + |