This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java in General and the fly likes Calendar (WEEK_OF_MONTH) ???? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Calendar (WEEK_OF_MONTH) ????" Watch "Calendar (WEEK_OF_MONTH) ????" New topic
Author

Calendar (WEEK_OF_MONTH) ????

Alexandre Martins
Greenhorn

Joined: May 21, 2002
Posts: 9
Hi folks,
i have a strange doubt about the classes of the type Calendar.
Before, i'd like to know if exists a method witch returns me the days in a week, of a month, in a year, something like getDaysOfWeekOfMonthInYear(int week, int month, int year) ?
I did not find anything about, so i decided to implement:

The code returns me the following results:

The problem is, why the new week just starts on the Monday? Shouldn't it start on Sundays?
Regards...
[ December 06, 2004: Message edited by: Alexandre Martins ]

Alexandre Martins Nunes<br />Rio de Janeiro - Brazil
Alexandre Martins
Greenhorn

Joined: May 21, 2002
Posts: 9
I got the answer to my own question.
I should set the first day of the week, witch depends on Locale.
use:
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Calendar (WEEK_OF_MONTH) ????