Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 214415
Collapse All | Expand All

(-)PeriodicCalendar-2.1/src/dateselect.cpp (+10 lines)
Lines 167-172 Link Here
167
        guint max_days;
167
        guint max_days;
168
        pDateSelectionDialogCalendar->get_date(new_year, new_month, new_day);
168
        pDateSelectionDialogCalendar->get_date(new_year, new_month, new_day);
169
        new_month = monthSpinButton->get_value_as_int()-1;
169
        new_month = monthSpinButton->get_value_as_int()-1;
170
        if((new_year == 1) && (new_month == 0)) {	// 0 because he did -1 in the line before
171
        // This is an invalid combination so we set it to february
172
            new_month++;
173
            monthSpinButton->set_value(new_month+1);
174
        }
170
        max_days = int(Glib::Date::get_days_in_month(Glib::Date::Month(new_month+1),new_year));
175
        max_days = int(Glib::Date::get_days_in_month(Glib::Date::Month(new_month+1),new_year));
171
        daySpinButton->set_range(1, max_days);
176
        daySpinButton->set_range(1, max_days);
172
        if(max_days<new_day) pDateSelectionDialogCalendar->select_day(max_days);
177
        if(max_days<new_day) pDateSelectionDialogCalendar->select_day(max_days);
Lines 184-189 Link Here
184
        guint max_days;
189
        guint max_days;
185
        pDateSelectionDialogCalendar->get_date(new_year, new_month, new_day);
190
        pDateSelectionDialogCalendar->get_date(new_year, new_month, new_day);
186
        new_year = yearSpinButton->get_value_as_int();
191
        new_year = yearSpinButton->get_value_as_int();
192
        if((new_year == 1) && (new_month == 0)) {
193
            // This is an invalid combination so we set it to february
194
            new_month++;
195
            monthSpinButton->set_value(new_month+1);
196
        }
187
        max_days = int(Glib::Date::get_days_in_month(Glib::Date::Month(new_month+1),new_year));
197
        max_days = int(Glib::Date::get_days_in_month(Glib::Date::Month(new_month+1),new_year));
188
        daySpinButton->set_range(1, max_days);
198
        daySpinButton->set_range(1, max_days);
189
        if(max_days<new_day) pDateSelectionDialogCalendar->select_day(max_days);
199
        if(max_days<new_day) pDateSelectionDialogCalendar->select_day(max_days);
(-)PeriodicCalendar-2.1/src/mainwindow.cpp (-2 / +7 lines)
Lines 1145-1156 Link Here
1145
    if(!(
1145
    if(!(
1146
        (cal_current_date.get_month() != model_current_date->get_month()) &&
1146
        (cal_current_date.get_month() != model_current_date->get_month()) &&
1147
        (cal_current_date > *model_current_date))) {
1147
        (cal_current_date > *model_current_date))) {
1148
        *model_current_date = (*model_current_date).subtract_months(1);
1148
1149
	// Glib doesn't like January of year 1	
1150
        if(!((model_current_date->get_month() == 2) && (model_current_date->get_year() == 1)))
1151
            *model_current_date = (*model_current_date).subtract_months(1);
1149
    }
1152
    }
1150
    refreshCalendarView();
1153
    refreshCalendarView();
1151
}
1154
}
1152
void PCalMainWindow::prevYear() {
1155
void PCalMainWindow::prevYear() {
1153
    *model_current_date = (*model_current_date).subtract_years(1);
1156
    if((model_current_date->get_year() != 1) &&
1157
        (!((model_current_date->get_year() == 2) && (model_current_date->get_month() == 1))))
1158
        *model_current_date = (*model_current_date).subtract_years(1);
1154
    refreshCalendarView();
1159
    refreshCalendarView();
1155
}
1160
}
1156
void PCalMainWindow::today() {
1161
void PCalMainWindow::today() {

Return to bug 214415