Read the Date documentation - the numbers you are passing in for
cutOffDate are not being treated how you expect them to.

For example, the year value is relative to 1900, so the actual year of
your cutOffDate is 3901.

The month is zero-relative so you're specifying July, which you
probably were not expecting.  It's stupid but that's the java Date
APIs for you!

On Nov 12, 4:36 am, rick_g <[EMAIL PROTECTED]> wrote:
> I'm trying to do a simple date comparison in GWT 1.5, and its not
> working.
>
> Here's my code:
>
> Date cutOffDate = new Date(2001, 6, 12);
> Date inputDate = dfApprovalDate.getValue();
> if (inputDate.after(cutOffDate)){
>         //do something} else {
>
>         //do something else
>
> }
>
> When I enter an input date of today (12 Nov 2008), it goes into the
> else block.
> Testing in hosted mode.
>
> Any ideas, alternatives?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to