Diffstat (limited to 'korganizer/datenavigator.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/datenavigator.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/korganizer/datenavigator.cpp b/korganizer/datenavigator.cpp index d2824de..8b7c993 100644 --- a/korganizer/datenavigator.cpp +++ b/korganizer/datenavigator.cpp @@ -150,16 +150,24 @@ void DateNavigator::selectWeekByDay( int weekDay, const QDate &d ) void DateNavigator::selectWeek() { QDate d = mSelectedDates.first(); selectWeek( d ); } void DateNavigator::selectWeek( int num ) { int year = mSelectedDates.first().year(); + QDate d = QDate ( year, 1,1); + while ( d.dayOfWeek() != 4 ) + d = d.addDays( 1 ); + selectWeek( d.addDays ( (num-1) *7 ) ); +} +void DateNavigator::selectWeekFromMonthView( int num ) +{ + int year = mSelectedDates.first().year(); if ( mSelectedDates.first().dayOfYear() > 300 && num < 10 ) ++year; if ( mSelectedDates.first().dayOfYear() < 70 && num > 40 ) --year; QDate d = QDate ( year, 1,1); while ( d.dayOfWeek() != 4 ) d = d.addDays( 1 ); selectWeek( d.addDays ( (num-1) *7 ) ); |