Calendar and FIRST_DAY_OF_WEEK

G

GfxGuy

I'm trying to write a simple display of any given month, outputting an
HTML string. The requirements are that we use a standard business week
(as defined by my company, anyway), which starts on Monday, not Sunday,
and for my own anal retentiveness, the each month needs to have a
uniform appearance... 6 rows, since that's the maximum number of
displayed weeks a month will have.

The calendar is very "week" centric. In other words, I don't care what
day the user selects, what is important is the week of the year.
Java's Calendar conveniently provides that to you.

So here's the problem. I set the first day of the week to be
Calendar.MONDAY. I'm wondering what effect this actually has, because
the week is still incremented every SUNDAY. This is true for the
WEEK_OF_THE_YEAR as well as the WEEK_OF_THE_MONTH, so it's both
screwing up my formatting and, more importantly, screwing up the
selected week if the user clicks on Sunday.

I have work arounds, but I'm really curious if I'm doing something
wrong, making wrong assumptions about how Calendar works, or if this
would be considered a bug.
 
P

P.Hill

GfxGuy said:
So here's the problem. I set the first day of the week to be
Calendar.MONDAY. I'm wondering what effect this actually has, because
the week is still incremented every SUNDAY.

Show the code please.

-Paul
 
B

bugbear

GfxGuy said:
I have work arounds, but I'm really curious if I'm doing something
wrong, making wrong assumptions about how Calendar works, or if this
would be considered a bug.

The source of Calendar is in the jdk if you need to know more
than the javadoc tells you, or suspect a bug.

BugBear
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,266
Latest member
DavidaAlla

Latest Threads

Top