Mantis - Resin
Viewing Issue Advanced Details
4094 minor always 06-30-10 07:19 01-17-11 14:05
nam  
ferg  
normal  
closed 4.0.7  
fixed  
none    
none 4.0.15  
0004094: com.caucho.util.QDate.setMonth() sets wrong month
Currently, QDate recalculates the _dayOfMonth after a setMonth() call. But if the old _dayOfMonth exceeds the number of days in the new _month, then _month is automatically incremented to become the intended month + 1.

Steps:
1. create a new QDate for 2010-12-31
2. qDate.setMonth(1) // February
3. qDate.getMonth() // returns March

Workaround:
Call setMonth(11), then setDayOfMonth(), and finally setMonth(). However, it's natural to assume that order of the setter calls shouldn't affect the outcome (as evidenced in Resin's own use of QDate).


Notes
(0004946)
ferg   
01-17-11 14:05   
server/1472