Could you please consider adding support for
setFirstDayOfWeek
to the appropriate Chronology classes?
This would make things more consistent with the java.util.Calendar API.
In particular, I am currently trying to compare the behaviour of java.util.Calendar, Joda and the Apache MyFaces Tomahawk calendar (javascript) with respect to handling weekOfWeekYear, but can only compare them for firstDayOfWeek=monday because Joda does not support other days.
Yes, I know that Monday is the official ISO first-day-of-week.
Thanks.
Logged In: YES
user_id=408725
Originator: NO
I suspect that adding this could be a little tricky. Its not at the top of my TODO list, especially with JSR-310 ongoing.
Logged In: NO
I've now implemented ymd<->ywd mapping functions in the Apache Myfaces Tomahawk project, including firstDayOfWeek support. See here:
http://svn.apache.org/repos/asf/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/dateformat/
and unit tests:
http://svn.apache.org/repos/asf/myfaces/tomahawk/trunk/core/src/test/java/org/apache/myfaces/dateformat/
In particular, see method SimpleDateFormatter.getWeekDate.
Joda is welcome to borrow code from there if desired. The Tomahawk code is of course APL2.0 licensed, but I am happy to release the code I wrote (esp. getWeekDate) under other licenses if necessary.
Regards, Simon
Might be able to add something to get the day of week value differently, but the "setFirstDayOfWeek" concept doesn't fit Joda-Time's API style