[Seaside] [Bug][Fix] WADateSelector
Avi Bryant
avi.bryant at gmail.com
Thu Jul 7 17:20:21 CEST 2005
On Jul 7, 2005, at 5:11 PM, Raymond Asselin wrote:
>>
>> Or
>> privateIsValidDay: theDay monthNumber: theMonth year: theYear
>> | maxDay |
>> theMonth >= 0 & (theMonth <= 12) ifFalse: [^false].
>> maxDay := Month daysInMonth: theMonth forYear: theYear.
>> ^theDay > 0 & (theDay <= maxDay)
>>
>
>
> I don't really understand the use of zero, as Squeak does'nt use zero
> base array like Forth...am I wrong?
You're not wrong, it's just an off-by-one error, I think. Should be
"the Month > 0 & (theMonth <= 12)". That code came from http://
lists.squeakfoundation.org/pipermail/seaside/2005-February/
004500.html, but I don't see anything there that would explain the
use of zero here, so I think it's just a bug.
Avi
More information about the Seaside
mailing list