Diffstat (limited to 'core/pim/datebook/datebookweekheaderimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/pim/datebook/datebookweekheaderimpl.cpp | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/core/pim/datebook/datebookweekheaderimpl.cpp b/core/pim/datebook/datebookweekheaderimpl.cpp index fd792e2..ff7626f 100644 --- a/core/pim/datebook/datebookweekheaderimpl.cpp +++ b/core/pim/datebook/datebookweekheaderimpl.cpp @@ -106,5 +106,5 @@ void DateBookWeekHeader::setDate(const QDate &d) { start.monthName(stop.month()) +" ("+ tr("w")+":"+QString::number( week ) +")"); - emit dateChanged(year,week); + emit dateChanged(date); } @@ -114,26 +114,2 @@ void DateBookWeekHeader::setStartOfWeek( bool onMonday ) setDate( date ); } - -// dateFromWeek -// compute the date from the week in the year -QDate dateFromWeek( int week, int year, bool startOnMonday ) -{ - QDate d; - d.setYMD( year, 1, 1 ); - int dayOfWeek = d.dayOfWeek(); - if ( startOnMonday ) { - if ( dayOfWeek <= 4 ) { - d = d.addDays( ( week - 1 ) * 7 - dayOfWeek + 1 ); - } else { - d = d.addDays( (week) * 7 - dayOfWeek + 1 ); - } - } else { - if ( dayOfWeek <= 4 || dayOfWeek == 7) { - d = d.addDays( ( week - 1 ) * 7 - dayOfWeek % 7 ); - } else { - d = d.addDays( ( week ) * 7 - dayOfWeek % 7 ); - } - } - return d; -} - |