Win a copy of Classic Computer Science Problems in Swift this week in the iOS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Calendar roll() method  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recently downloaded a Date Picker control that has the strange behavior of going from Dec. 2003 (for example) to Jan. 2003 when I choose the 'next month' button ('>'). Researching the problem I discovered that this occurs because the author chose to use the Calendar roll() method, rather than the add() method. Studying the Javadocs for roll() I can't help but wonder what is the value of this method? Why would anyone ever want to use roll()?
It appears to me that this method might occasionally give the correct values, but would very often give incorrect results. So, can anyone explain to me when they would truly want to use the roll() method?
Dave Derry
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!