Return-Path: Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: (qmail 86208 invoked from network); 16 Nov 2006 22:13:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Nov 2006 22:13:03 -0000 Received: (qmail 61169 invoked by uid 500); 16 Nov 2006 22:13:12 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 60832 invoked by uid 500); 16 Nov 2006 22:13:11 -0000 Mailing-List: contact dev-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list dev@myfaces.apache.org Received: (qmail 60796 invoked by uid 99); 16 Nov 2006 22:13:10 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Nov 2006 14:13:10 -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; Thu, 16 Nov 2006 14:12:59 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 93187714330 for ; Thu, 16 Nov 2006 14:12:39 -0800 (PST) Message-ID: <20952785.1163715159599.JavaMail.jira@brutus> Date: Thu, 16 Nov 2006 14:12:39 -0800 (PST) From: "Richard J. Barbalace (JIRA)" To: dev@myfaces.apache.org Subject: [jira] Created: (TOMAHAWK-787) Incorrect display of 12-hour time in t:inputCalendar MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Incorrect display of 12-hour time in t:inputCalendar ---------------------------------------------------- Key: TOMAHAWK-787 URL: http://issues.apache.org/jira/browse/TOMAHAWK-787 Project: MyFaces Tomahawk Issue Type: Bug Components: Calendar Affects Versions: 1.1.4-SNAPSHOT, 1.1.5-SNAPSHOT Reporter: Richard J. Barbalace If the date format attribute specifies 12-hour time, as in: popupDateFormat="d MMM yyyy hh:mm:ss a" rather than 24-hour time, as in: popupDateFormat="d MMM yyyy HH:mm:ss" then the display from the calendar still reports 24-hour time, yielding something like this: Today is 16 Nov 2006 16:23:04 AM That of course should read as: Today is 16 Nov 2006 04:23:04 PM I suspect the bug involves the code beginning around line 344 of core/src/main/resources/org/apache/myfaces/custom/calendar/resource/date.js which reads: else if(patternSub.charAt(0)=='H' || patternSub.charAt(0)=='h') There should probably be separate cases for 'H' and 'h', for which the latter would subtract 12 from the context.hour, but I am not familiar enough with this code to be sure. There might also be an issue with the AM/PM setting further down the file around line 381. There are, in case anyone wonders why the time should be set from a calendar control, valid reasons for doing this, such as in my application where it is desired to be able to correct the date on an incorrectly entered timestamp from some other source. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira