-rw-r--r-- | libkcal/incidencebase.cpp | 4 | ||||
-rw-r--r-- | libkcal/todo.cpp | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/libkcal/incidencebase.cpp b/libkcal/incidencebase.cpp index 1e99082..b5fe2e6 100644 --- a/libkcal/incidencebase.cpp +++ b/libkcal/incidencebase.cpp | |||
@@ -195,25 +195,27 @@ QDateTime IncidenceBase::dtStart() const | |||
195 | QString IncidenceBase::dtStartTimeStr() const | 195 | QString IncidenceBase::dtStartTimeStr() const |
196 | { | 196 | { |
197 | return KGlobal::locale()->formatTime(dtStart().time()); | 197 | return KGlobal::locale()->formatTime(dtStart().time()); |
198 | } | 198 | } |
199 | 199 | ||
200 | QString IncidenceBase::dtStartDateStr(bool shortfmt) const | 200 | QString IncidenceBase::dtStartDateStr(bool shortfmt) const |
201 | { | 201 | { |
202 | return KGlobal::locale()->formatDate(dtStart().date(),shortfmt); | 202 | return KGlobal::locale()->formatDate(dtStart().date(),shortfmt); |
203 | } | 203 | } |
204 | 204 | ||
205 | QString IncidenceBase::dtStartStr(bool shortfmt) const | 205 | QString IncidenceBase::dtStartStr(bool shortfmt) const |
206 | { | 206 | { |
207 | return KGlobal::locale()->formatDateTime(dtStart(), shortfmt); | 207 | if ( doesFloat() ) |
208 | return KGlobal::locale()->formatDate(dtStart().date(),shortfmt); | ||
209 | return KGlobal::locale()->formatDateTime(dtStart(), shortfmt); | ||
208 | } | 210 | } |
209 | 211 | ||
210 | 212 | ||
211 | bool IncidenceBase::doesFloat() const | 213 | bool IncidenceBase::doesFloat() const |
212 | { | 214 | { |
213 | return mFloats; | 215 | return mFloats; |
214 | } | 216 | } |
215 | 217 | ||
216 | void IncidenceBase::setFloats(bool f) | 218 | void IncidenceBase::setFloats(bool f) |
217 | { | 219 | { |
218 | if (mReadOnly) return; | 220 | if (mReadOnly) return; |
219 | mFloats = f; | 221 | mFloats = f; |
diff --git a/libkcal/todo.cpp b/libkcal/todo.cpp index 39d16b6..a496404 100644 --- a/libkcal/todo.cpp +++ b/libkcal/todo.cpp | |||
@@ -182,25 +182,27 @@ QDateTime Todo::dtDue() const | |||
182 | QString Todo::dtDueTimeStr() const | 182 | QString Todo::dtDueTimeStr() const |
183 | { | 183 | { |
184 | return KGlobal::locale()->formatTime(mDtDue.time()); | 184 | return KGlobal::locale()->formatTime(mDtDue.time()); |
185 | } | 185 | } |
186 | 186 | ||
187 | QString Todo::dtDueDateStr(bool shortfmt) const | 187 | QString Todo::dtDueDateStr(bool shortfmt) const |
188 | { | 188 | { |
189 | return KGlobal::locale()->formatDate(mDtDue.date(),shortfmt); | 189 | return KGlobal::locale()->formatDate(mDtDue.date(),shortfmt); |
190 | } | 190 | } |
191 | 191 | ||
192 | QString Todo::dtDueStr(bool shortfmt) const | 192 | QString Todo::dtDueStr(bool shortfmt) const |
193 | { | 193 | { |
194 | return KGlobal::locale()->formatDateTime(mDtDue, shortfmt); | 194 | if ( doesFloat() ) |
195 | return KGlobal::locale()->formatDate(mDtDue.date(),shortfmt); | ||
196 | return KGlobal::locale()->formatDateTime(mDtDue, shortfmt); | ||
195 | } | 197 | } |
196 | // retval 0 : no found | 198 | // retval 0 : no found |
197 | // 1 : due for date found | 199 | // 1 : due for date found |
198 | // 2 : overdue for date found | 200 | // 2 : overdue for date found |
199 | int Todo::hasDueSubTodoForDate( const QDate & date, bool checkSubtodos ) | 201 | int Todo::hasDueSubTodoForDate( const QDate & date, bool checkSubtodos ) |
200 | { | 202 | { |
201 | int retval = 0; | 203 | int retval = 0; |
202 | if ( isCompleted() ) | 204 | if ( isCompleted() ) |
203 | return 0; | 205 | return 0; |
204 | if ( hasDueDate() ) { | 206 | if ( hasDueDate() ) { |
205 | if ( dtDue().date() < date ) | 207 | if ( dtDue().date() < date ) |
206 | return 2; | 208 | return 2; |