Return-Path: Delivered-To: apmail-myfaces-dev-archive@www.apache.org Received: (qmail 18953 invoked from network); 31 Jan 2006 11:02:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 31 Jan 2006 11:02:02 -0000 Received: (qmail 32852 invoked by uid 500); 31 Jan 2006 11:01:55 -0000 Delivered-To: apmail-myfaces-dev-archive@myfaces.apache.org Received: (qmail 32826 invoked by uid 500); 31 Jan 2006 11:01:55 -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 32814 invoked by uid 99); 31 Jan 2006 11:01:55 -0000 X-ASF-Spam-Status: No, hits=1.3 required=10.0 tests=SPF_FAIL X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Jan 2006 03:01:54 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id D3A6CCB for ; Tue, 31 Jan 2006 12:01:33 +0100 (CET) Message-ID: <468450731.1138705293865.JavaMail.jira@ajax.apache.org> Date: Tue, 31 Jan 2006 12:01:33 +0100 (CET) From: "Martin Marinschek (JIRA)" To: dev@myfaces.apache.org Subject: [jira] Commented: (MYFACES-1045) formatInt does not accept numerical values, which causes JS exception when selecting year from dropdown list. In-Reply-To: <482994652.1137750342366.JavaMail.jira@ajax.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/MYFACES-1045?page=comments#action_12364557 ] Martin Marinschek commented on MYFACES-1045: -------------------------------------------- What do you mean by that comment? regards, Martin > formatInt does not accept numerical values, which causes JS exception when selecting year from dropdown list. > ------------------------------------------------------------------------------------------------------------- > > Key: MYFACES-1045 > URL: http://issues.apache.org/jira/browse/MYFACES-1045 > Project: MyFaces > Type: Bug > Components: Tomahawk > Versions: 1.1.0 > Environment: Windows XP SP2, IE 6.0, Firefox 1.5 > Reporter: Stephane Vandenbussche > Attachments: popcalendar.js > > In file popcalendar.js in the Tomahawk.jar, the function formatint fails to accept numerical values that are passed by other functions. You can not assume that every value passed to this function will be a string. > It is important to fix this in version 1.1.0 because not all projects can upgrade to version 1.1.1 because of backward compatibilty issues and project history. > The following implementation makes the function much safer to use with various browsers. > function formatInt(str){ > if (!str || (typeof str == "undefined")) { > return str; > } > // first convert anything to string > var result = "" + str; > if (result.charAt(0)=="0") { > //truncate 0 for number less than 10 > return result.charAt(1); > } else { > return result; > } > } -- 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