Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 29114 invoked from network); 29 Jan 2007 13:40:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Jan 2007 13:40:31 -0000 Received: (qmail 10952 invoked by uid 500); 29 Jan 2007 13:39:22 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 10873 invoked by uid 500); 29 Jan 2007 13:39:22 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 10860 invoked by uid 99); 29 Jan 2007 13:39:22 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jan 2007 05:39:22 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Jan 2007 05:39:09 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 4421D7142E1 for ; Mon, 29 Jan 2007 05:38:49 -0800 (PST) Message-ID: <10258684.1170077929276.JavaMail.jira@brutus> Date: Mon, 29 Jan 2007 05:38:49 -0800 (PST) From: "Carsten Drossel (JIRA)" To: commons-dev@jakarta.apache.org Subject: [jira] Created: (VALIDATOR-221) DateValidator considers "02/29" with format "MM/dd" invalid MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org DateValidator considers "02/29" with format "MM/dd" invalid ----------------------------------------------------------- Key: VALIDATOR-221 URL: https://issues.apache.org/jira/browse/VALIDATOR-221 Project: Commons Validator Issue Type: Bug Affects Versions: 1.3.1 Release Environment: Windows XP, Java 1.5.0_04 Reporter: Carsten Drossel Priority: Minor When the date pattern contains only day and month the isValid(..)-method of DateValidator returns false for the value Feb. 29th. Here is a JUnit test that fails: public void testFebruary29th() throws Exception { assertTrue( DateValidator.getInstance().isValid( "02/29", "MM/dd", true ) ); } The DateValidator uses the parse(..)-method of SimpleDateFormat for the validation. This method appears to complete any date using 01/01/1970 00:00. Since 1970 was not a leap year a ParseException is thrown for the input "02/29" with the format "MM/dd" because 02/29/1970 is not a valid date. But IMHO "02/29" should be valid. An example where it makes sense is a search for persons with a certain birthday. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org