Changeset 423 for XIOS/trunk
- Timestamp:
- 02/25/13 01:15:54 (11 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/calendar_util.cpp
r343 r423 70 70 71 71 // Ajustement des mois en fonction des jours. 72 int signVal = (drr.day != 0) ? drr.day/fabs(drr.day) : 0;73 72 CDate dtt(dt); 74 if (signVal < 0) dtt.addMonth (signVal); 73 drr.day+=dtt.getDay()-1 ; 74 dtt.setDay(1) ; 75 75 76 for(; c.getMonthLength(dtt) < fabs(drr.day); dtt.addMonth (signVal)) 77 { drr.day -= signVal * c.getMonthLength(dtt); drr.month += signVal; } 76 if ( drr.day >= 0 ) 77 { 78 for(; c.getMonthLength(dtt) <= drr.day; dtt.addMonth (1)) 79 { drr.day -= c.getMonthLength(dtt); drr.month += 1 ; } 78 80 79 day += dt.getDay() + drr.day; 81 day = drr.day+1 ; 82 } 83 else 84 { 85 dtt.addMonth(-1) ; 86 for(; c.getMonthLength(dtt) < -drr.day; dtt.addMonth (-1)) 87 { drr.day+=c.getMonthLength(dtt) ; drr.month-=1 ; } 88 day=c.getMonthLength(dtt)+drr.day+1 ; 89 } 90 91 /* 80 92 if (day < 0) { drr.month --; day += c.getMonthLength(dtt); } 81 if (day > =c.getMonthLength(dtt)) { drr.month ++; day -= c.getMonthLength(dtt); } // << ProblÚme ici93 if (day > c.getMonthLength(dtt)) { drr.month ++; day -= c.getMonthLength(dtt); } // << ProblÚme ici 82 94 if (day == 0){ day = c.getMonthLength(dtt); drr.month --; } 83 95 */ 84 96 drr.resolve(dt.getRelCalendar()); 85 97 -
XIOS/trunk/src/date.cpp
r343 r423 177 177 void CDate::setYear (int newyear) { this->year = newyear; } 178 178 void CDate::setMonth (int newmonth) { this->month = newmonth; } 179 void CDate::setDay (int newday) { this->day = newday; } 179 180 180 181 //---------------------------------------------------------------- -
XIOS/trunk/src/date.hpp
r343 r423 50 50 void setYear (int newyear); 51 51 void setMonth (int newmonth); 52 void setDay (int newday); 52 53 53 54 void addMonth (int value);
Note: See TracChangeset
for help on using the changeset viewer.