posted 20 years ago
There are two possible alternatives to this:
a. Create calendar objects and compare the relevant fields of the calendar instances (day, month, year...).
b. Change the code to something like
int tolerableDifference = 24 * 60 * 60 * 1000; // milliseconds
return Math.abs(beginDate.getTime() - selectedDate.getTime()) < tolerableDifference;
Here, it should return true only if they represent the same date upto the day. (Caution: This algorithm might need some testing/debugging thow.)
Perhaps the first one is preferable.
Hope this helps.
ASCII silly question, Get a silly ANSI.