in reply to Year /^\d+$/ bug!
For example, a billing statement often, by law, needs to provide a set number of days. When implementing that sort of system, you find out what the client's accountants use when balancing the books and go from there.
On the other hand, a calender is generally looking for something to the effect of Dec 30 to Jan 30.
To handle the "Feb 30" problem, I usually decrement the previous result by one day until I have a valid date. The next search then becomes Mar 28 (or 29, depending on the year).
If you're not completely comfortable forcing either approach, then use gaspodethewonderdog's idea: implement both and then let the end user/developer choose which they prefer via a property or configuration setting.
--f
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Year /^\d+$/ bug!
by Blue (Hermit) on Nov 30, 2000 at 19:57 UTC |