Thursday, January 3, 2008

Bug of the Day

This is a bug I found today, and it might be my most amusing bug ever:

We have a feature that lets you pick a date. I logged in today and noticed that I couldn't pick today.... or yesterday. I couldn't pick any date in 2008.


Here's the code (note: real code not shown to prevent IP issues):

/************************************************************************
* Writes HTML code for the date form. Combo-boxes
* are shown for the year, month and day after which stuff should be done.
* A JavaScript calendar is also included.
*/

private static void showDateForm (Locale locale) {
Calendar mycal = new calendar(locale)
//move time back a week
mycal.add(Calendar.TODAY-7)
int nowyear = mycal.YEAR
int nowmonth = mycal.MONTH
int nowday = mycal.DAY
}

No, we don't know why they did this. Our best guess is that the date defaults to one week ago and they kind of screwed up the implementation of it.

I'm amused. :)

No comments:

Post a Comment