Re: Calendar chooser problem
- From: "Niels Dybdahl" <ndy@xxxxxxxxxxxxxxxxx>
- Date: Thu, 26 May 2005 08:59:02 +0200
> CalendarChooser objFromDate = new CalendarChooser () ;
> CalendarChooser objToDate = new CalendarChooser () ;
> Date dtFrom = objFromDate.getDate () ;
> Date dtTo = objToDate.getDate () ;
> return dtFrom.compareTo ( dtTo ) ;
>
> The last line does not return 0 even if identical dates were selected.
Date does also include the time. So if you really only want to compare the
dates, then create new dates like:
Date dtFromDateOnly = new Date(dtFrom.getYear(), dtFrom.getMonth(),
dtFrom.getDate(), 0, 0, 0);
Or you might use similar functions from Calendar as most of the functions
above are deprecated.
Niels Dybdahl
.
- References:
- Calendar chooser problem
- From: bilaribilari
- Calendar chooser problem
- Prev by Date: Re: Creating a unique random id
- Next by Date: Re: ain't java grand ?
- Previous by thread: Re: Calendar chooser problem
- Next by thread: Re: Calendar chooser problem
- Index(es):
Relevant Pages
|