DO NOT REPLY [Bug 31602] - [lang] DateUtils should be able to adjust for weekends, etc.

2006-04-16 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31602


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||WONTFIX




--- Additional Comments From [EMAIL PROTECTED]  2006-04-16 17:07 ---

Agreement on commons-dev to WONTFIX this one. From Stephen:

"-1, This stalled because its a mess of possible issues. There isn't even
a solution in Joda-Time yet."

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 31602] - [lang] DateUtils should be able to adjust for weekends, etc.

2004-10-14 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31602

[lang] DateUtils should be able to adjust for weekends, etc.





--- Additional Comments From [EMAIL PROTECTED]  2004-10-15 01:38 ---
I'm not sure what the problem is with the public int[].  Yes it can be 
modified by anyone but what is the harm or purpose of that?  I do agree with 
your point about the fix (inner classes) being worse than the cure.  Obviously 
this would be a perfect case for type safe enums which could be declared final.

I don't have an objection to reverting back to the original idea of assuming 
weekend to be Saturday or Sunday (and documenting this assumption.)

I see your point about including Calendar as well as Date.  Also point well 
taken about the Calendar.getInstance().  I don't know why my implementation 
was inconsistent on that point.

Finally, I prefer adjustUntilNotWeekend and adjustUntilNotDays as the method 
names (instead of addDaysIgnoreWeekend.)  This is assuming we are talking 
about the same method I initially proposed.  The point of the method is to 
ensure the Date is not a weekend.  So if it is already not a weekend no adding 
(or subtracting) is needed.  So for this reason I think your method name 
change might be a bit misleading.  Of course, I may be misinterpreting your 
point here...

Shall I work up some new patches along these lines?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 31602] - [lang] DateUtils should be able to adjust for weekends, etc.

2004-10-13 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31602

[lang] DateUtils should be able to adjust for weekends, etc.





--- Additional Comments From [EMAIL PROTECTED]  2004-10-13 21:59 ---
This patch suffers from a problem that the public int[] can be modified by 
anyone. (This is a Java design flaw - the language should support immutable 
arrays.)

One solution might be to design an inner class that represents a time type (eg. 
days and a list of values). That way you could define an object to 
exclude/include a range of months or hours as well as days. However, I can 
quickly see the scope growing greatly.

Thus I'm tempted to go back to a simpler more focussed approach:
- isWeekend(date) (Sat/Sun)
- isDayOfWeek(date, int[] daysOfWeek)
- addDaysIgnoreWeekend(date, amount)
- addDaysIgnoreDays(date, amount, int[] ignoreDays)
That way the most common case is clear, the international case can be handled, 
and the sat/sun constant is not exposed.

Also, all methods must be for both Date and Calendar. And the Date ones must 
use Calendar.getInstance() to get the Calendar object.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 31602] - [lang] DateUtils should be able to adjust for weekends, etc.

2004-10-08 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31602

[lang] DateUtils should be able to adjust for weekends, etc.





--- Additional Comments From [EMAIL PROTECTED]  2004-10-08 14:12 ---
Created an attachment (id=12999)
[PATCH] DateUtilsTest

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 31602] - [lang] DateUtils should be able to adjust for weekends, etc.

2004-10-08 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31602

[lang] DateUtils should be able to adjust for weekends, etc.





--- Additional Comments From [EMAIL PROTECTED]  2004-10-08 14:12 ---
Created an attachment (id=12998)
[PATCH] DateUtils

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]