author | harlekin <harlekin> | 2002-11-27 14:19:09 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-11-27 14:19:09 (UTC) |
commit | 5f0c90d4b6972c1ad22ba20b45cd1d3f88298099 (patch) (unidiff) | |
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, | |||
59 | // start time of event | 59 | // start time of event |
60 | msg += "<br>" + ampmTime(QTime( (ev).event().start().time() ) ) | 60 | QDate tempDate = (ev).event().start().date(); |
61 | msg += "<br>" | ||
62 | + ampmTime( QTime( (ev).event().start().time() ) ) | ||
61 | // end time of event | 63 | // end time of event |
62 | + "<b> - </b>" + ampmTime(QTime( (ev).event().end().time() ) ); | 64 | + "<b> - </b>" + ampmTime( QTime( (ev).event().end().time() ) ) |
65 | + differDate( tempDate ); | ||
63 | } | 66 | } |
@@ -97,2 +100,19 @@ QString DateBookEvent::ampmTime( QTime tm ) { | |||
97 | 100 | ||
101 | QString DateBookEvent::differDate( QDate date ) { | ||
102 | QDate currentDate = QDate::currentDate(); | ||
103 | QString returnText = "<font color = #407DD9><b> "; | ||
104 | int differDate = currentDate.daysTo( date ); | ||
105 | if ( currentDate.dayOfWeek() == date.dayOfWeek() ) { | ||
106 | returnText += "" ; | ||
107 | // not working right for recurring events | ||
108 | //} else if ( differDate == 1 ) { | ||
109 | //returnText += tr( "tomorrow" ); | ||
110 | } else { | ||
111 | //returnText += tr( "in %1 days" ).arg( differDate ); | ||
112 | returnText += " [ " + date.dayName( date.dayOfWeek() ) + " ] "; | ||
113 | } | ||
114 | returnText += "</b></font>"; | ||
115 | return returnText; | ||
116 | } | ||
117 | |||
98 | 118 | ||