[program-java] Re: date validation

  • From: "J. R. Westmoreland" <jr@xxxxxxx>
  • To: <program-java@xxxxxxxxxxxxx>
  • Date: Thu, 22 Jan 2009 12:09:45 -0700

Have you tried java.sun.com? I recall seeing a date validation class there
some time ago.

I started to convert a date conversion routine that we used in our metering
software system to jave but never finished it.

You would pass it a string and it would return you a system date. The string
input could even be something like this:

"today", "last week", "next month", "today + 8 days".

Some day I'll get it finished. <grin>

 

J. R.

 

--------------------

J. R. Westmoreland

E-mail: jr@xxxxxxx

 

From: program-java-bounce@xxxxxxxxxxxxx
[mailto:program-java-bounce@xxxxxxxxxxxxx] On Behalf Of Anna Giller
Sent: Thursday, January 22, 2009 11:39 AM
To: program-java@xxxxxxxxxxxxx
Subject: [program-java] date validation

 

Jim:

 

Do you have a date validation routine?

I have one, it's ugly enough. It checks the value of the month, then the
value of the day, compares it with the array of valid values.

I need more professional one, that uses Java classes.

 

I was also looking for a numeric field validation, but just found one.

And want to share it with our people.

It's neat, isn't it?

I'm looking for a date validation routine in the similar style.

 

Thank you and the code follows.

Anna 

 

  int number=0;   

      while (number == 0) {   

    String input=JOptionPane.showInputDialog("\n\tEnter numeric value.");   

    try{   

number=Integer.parseInt(input);   

    }catch(NumberFormatException nfe)   

    {   

Number = 0;   

    }   

 

Other related posts: