struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Thomas <p...@tmsl.demon.co.uk>
Subject Re: Newbie.... Best Practices for ActionForms
Date Mon, 02 Jun 2003 22:26:30 GMT

On 02/06/2003 16:38 Aaron Longwell wrote:

> Could someone with experiece in this area give me a brief explanation of 
> the recommended workflow for editing dates?

Don't about recommended but...

For the first Struts app using 1.0.2 I wrote, I allowed dates to be input 
into a text box and used java.text.SimpleDateFormat to parse them into 
java.util.Date objects. That worked OK-ish but can inerpret the year in 
some odd ways such as treating -3 as as BC date when it was more likely a 
type of 03. What I do now is input all my dates using option pull-downs 
then simply check the day of month is in range for the month by throwing 
day, month, year at a GregorianCalendar (with setLenient(false) of course).

HTH


-- 
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller 
Business |
| Computer Consultants         | 
http://www.thomas-micro-systems-ltd.co.uk   |
+------------------------------+---------------------------------------------+

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Mime
View raw message