Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 11730 invoked from network); 2 Jun 2008 20:50:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Jun 2008 20:50:10 -0000 Received: (qmail 25675 invoked by uid 500); 2 Jun 2008 20:50:11 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 25577 invoked by uid 500); 2 Jun 2008 20:50:11 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 25566 invoked by uid 99); 2 Jun 2008 20:50:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jun 2008 13:50:11 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jun 2008 20:49:23 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 19CEC234C12E for ; Mon, 2 Jun 2008 13:49:45 -0700 (PDT) Message-ID: <1891418207.1212439785104.JavaMail.jira@brutus> Date: Mon, 2 Jun 2008 13:49:45 -0700 (PDT) From: "Robert Scholte (JIRA)" To: issues@commons.apache.org Subject: [jira] Commented: (LANG-440) DateUtils.round doesn't work correct for Calendar.AM_PM In-Reply-To: <1423364544.1212439785062.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/LANG-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601756#action_12601756 ] Robert Scholte commented on LANG-440: ------------------------------------- Patch is on it's way > DateUtils.round doesn't work correct for Calendar.AM_PM > ------------------------------------------------------- > > Key: LANG-440 > URL: https://issues.apache.org/jira/browse/LANG-440 > Project: Commons Lang > Issue Type: Bug > Affects Versions: 2.4 > Reporter: Robert Scholte > Fix For: 3.0 > > > The provided JUnit-tests test with wrong expected values > {code:title= original DateUtilsTest.java} > dateAmPm1 = dateTimeParser.parse("February 3, 2002 01:10:00.000"); > dateAmPm2 = dateTimeParser.parse("February 3, 2002 11:10:00.000"); > dateAmPm3 = dateTimeParser.parse("February 3, 2002 13:10:00.000"); > dateAmPm4 = dateTimeParser.parse("February 3, 2002 19:10:00.000"); > assertEquals("truncate ampm-1 failed", > dateTimeParser.parse("February 3, 2002 00:00:00.000"), > DateUtils.round(dateAmPm1, Calendar.AM_PM)); > assertEquals("truncate ampm-2 failed", > dateTimeParser.parse("February 4, 2002 00:00:00.000"), > DateUtils.round(dateAmPm2, Calendar.AM_PM)); > assertEquals("truncate ampm-3 failed", > dateTimeParser.parse("February 3, 2002 12:00:00.000"), > DateUtils.round(dateAmPm3, Calendar.AM_PM)); > assertEquals("truncate ampm-4 failed", > dateTimeParser.parse("February 4, 2002 12:00:00.000"), > DateUtils.round(dateAmPm4, Calendar.AM_PM)); > {code} > but expected values must be > {code} > dateTimeParser.parse("February 3, 2002 00:00:00.000"); > dateTimeParser.parse("February 3, 2002 12:00:00.000"); > dateTimeParser.parse("February 3, 2002 12:00:00.000"); > dateTimeParser.parse("February 4, 2002 00:00:00.000"); > {code} > Also in the junit-comment the word 'truncate' must be replaced with 'round' -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.