Changeset 1496
- Timestamp:
- 04/27/18 11:00:44 (7 years ago)
- Location:
- XIOS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/XIOS_DEV_CMIP6/src/date.cpp
r1158 r1496 235 235 void CDate::addMonth(int value) 236 236 {// Value doit être égale à 1 ou -1. 237 238 const CCalendar& c = getRelCalendar(); 239 int nbMonthsPerYear = c.getYearLength(); 240 237 241 this->month += value; 238 if (this->month == 13) { year++; this->month = 1; } 239 if (this->month == 0) { year--; this->month = 12; } 242 243 if (this->month == nbMonthsPerYear + 1) { year++; this->month = 1; } 244 if (this->month == 0) { year--; this->month = nbMonthsPerYear; } 240 245 } 241 246 -
XIOS/trunk/src/date.cpp
r1105 r1496 235 235 void CDate::addMonth(int value) 236 236 {// Value doit être égale à 1 ou -1. 237 238 const CCalendar& c = getRelCalendar(); 239 int nbMonthsPerYear = c.getYearLength(); 240 237 241 this->month += value; 238 if (this->month == 13) { year++; this->month = 1; } 239 if (this->month == 0) { year--; this->month = 12; } 242 243 if (this->month == nbMonthsPerYear + 1) { year++; this->month = 1; } 244 if (this->month == 0) { year--; this->month = nbMonthsPerYear; } 245 240 246 } 241 247
Note: See TracChangeset
for help on using the changeset viewer.