Return-Path: Delivered-To: apmail-struts-user-archive@www.apache.org Received: (qmail 78682 invoked from network); 22 Nov 2006 13:22:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Nov 2006 13:22:24 -0000 Received: (qmail 26341 invoked by uid 500); 22 Nov 2006 13:22:22 -0000 Delivered-To: apmail-struts-user-archive@struts.apache.org Received: (qmail 26307 invoked by uid 500); 22 Nov 2006 13:22:22 -0000 Mailing-List: contact user-help@struts.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Struts Users Mailing List" Reply-To: "Struts Users Mailing List" Delivered-To: mailing list user@struts.apache.org Received: (qmail 26295 invoked by uid 99); 22 Nov 2006 13:22:22 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Nov 2006 05:22:22 -0800 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [153.107.41.145] (HELO hplmx1.det.nsw.edu.au) (153.107.41.145) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 22 Nov 2006 05:22:07 -0800 Received: from itfsmtp6.central.det.win (externalmail.det.nsw.edu.au [153.107.8.159]) by hplmx1.det.nsw.edu.au (8.13.1/8.13.1) with ESMTP id kAMDLiPK026826 for ; Thu, 23 Nov 2006 00:21:44 +1100 Received: from itfexhub4.central.det.win (Not Verified[153.107.9.31]) by itfsmtp6.central.det.win with MailMarshal (v6,1,8,2137) id ; Thu, 23 Nov 2006 00:21:43 +1100 Received: from itfexch4.central.det.win ([153.107.9.48]) by itfexhub4.central.det.win with Microsoft SMTPSVC(6.0.3790.1830); Thu, 23 Nov 2006 00:21:43 +1100 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: Date validation Date: Thu, 23 Nov 2006 00:21:43 +1100 Message-ID: <7674B8B2F9705845ADA12ABA2F2081490D3121@itfexch4.central.det.win> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Date validation Thread-Index: AccOIsAt7WhFnzy8SeG59QRNJaGdegAE4c1C References: <7488591.post@talk.nabble.com> From: "Strachan, Paul" To: "Struts Users Mailing List" X-OriginalArrivalTime: 22 Nov 2006 13:21:43.0607 (UTC) FILETIME=[2725EC70:01C70E39] X-Virus-Checked: Checked by ClamAV on apache.org Hi, what exact value did you enter with the date pattern MM/dd/yy? =20 I dont like datePatternStrict because you have to enter the leading zero = for dd and MM; and the year should format according to java.text.SimpleDa= teFormat rules. =20 I use dd/MM/yyyy (not strict) and the user can type the full year. I usua= lly accompany "date" with my own custom date validators to ensure the dat= e entered is in a valid range (eg >=3D today, between today-80 and today+= 20) =20 While day and month are always meaningful, year could be almost anything.= ..if user types "2" should that be 1902, 2002 or even 2012 or 1992 ? =20 Although you could write a custom validator and try to handle 2 /4 digit = years - you still have to work out the "real" year; which is a combinatio= n of=20 1. what year did the user intend? 2. what year does my application expect/want? =20 Solution 1. use the yyyy pattern 2. use extra validation =20 Good Luck ________________________________ From: vacak [mailto:phusztek@gmail.com] Sent: Wed 22/11/2006 9:40 PM To: user@struts.apache.org Subject: Date validation =20 Hi, =20 I use Validator 1.0 and I would like to validate date fields with the= format MM/dd/yy but it works only with the format: MM/dd/yyyy. In the validation.xml i use this: =20 =20
=20 =20 =20 =20 datePatternStrict =20 MM/dd/yy =20 =20 So i changed the to the format i need but it still doesn't wo= rk. What could be the problem? And what shall i do if i want to accept the bo= th format? (MM/dd/yy and MM/dd/yyyy) Thanks -- View this message in context: http://www.nabble.com/Date-validation-tf268= 4724.html#a7488591 Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org ********************************************************************** This message is intended for the addressee named and may contain privileged information or confidential information or both. If you are not the intended recipient please delete it and notify the sender. ********************************************************************** --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@struts.apache.org For additional commands, e-mail: user-help@struts.apache.org