Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using Calendar class  RSS feed

 
Ansar Shah
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

Can any body elaborate, how to get maximum number of weeks in a month given Calendar instance? For example in December 2007, if the first day of week is set to Calendar.SATURDAY, then total weeks should be 6. And it should be 5 in case the first day of week is set to Calendar.MONDAY.

The getMaximum(Calendar.WEEK_OF_MONTH) always returns 6;
and getMinimum(Calendar.WEEK_OF_MONTH) always returns 0.

Please help.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!