|
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); |