Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8984143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T21:01:16+00:00 2026-06-15T21:01:16+00:00

I am using 2 GWT datepickers and a JAVA date object. I want to

  • 0

I am using 2 GWT datepickers and a JAVA date object. I want to check if the current date (from the now() function) is in between the dates selected in the datepickers.
I have 2 questions:

  1. How do I ensure that the date picked in the second date picker is atleast the same or later than the one picked in the first one?

  2. I want to set the same date in both date pickers and check my current date against it. I tried to do this by setting the time on my second date to 11:59:59 PM, but it says that the Date.setHours and setMinutes methods are depricated.

Any ideas? Appreciate any help.

p.s. Please dont tell me to use Calendar or any other date function. My constraint is that I need to use java.util.Date.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T21:01:17+00:00Added an answer on June 15, 2026 at 9:01 pm

    To compare dates simply use

    date2.getTime() >= date1.getTime();
    

    Note that you can’t compare dates directly – Java allows it but there are issues in JavaScript.

    To set the same dates, get date from one date picker, and set it to another.

    Also note there is a CalendarUtil class in GWT (com.google.gwt.user.datepicker.client.CalendarUtil) which has limited functionality, but it is still very useful in many situations.

    You can use deprecated methods with Date objects – no one plans to remove them any time soon. I try to avoid them by using milliseconds when possible, but it’s so much easier, for example, to check a day of the week using a deprecated method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using GWT/JAVA for development. I have following problem: I want to remove
I am using GWT and want to so validation of email using the java
I'm using GWT RPC to communicate between client and server. I want to be
While developing an application using gwt in ecliplse crashed. Now the server is running
I am using GWT-CKEditor for my application. And I want to test it through
I am using GWT + MVP4G, In my application I want to make my
Now i am using GWT , I am trying to change the image path,
I am using GWT-RPC to populate Ext-GWT TreeGrids with data from a server. I
I'm using GWT 2.4 and uiBinder to add widgets to a page. Now I
I am using GWT api for google charts and having some issues: colums from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.