[richfaces-svn-commits] JBoss Rich Faces SVN: r15856 - in branches/sandbox/3.3.X_JSF2: ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts and 1 other directory.

richfaces-svn-commits at lists.jboss.org richfaces-svn-commits at lists.jboss.org
Mon Nov 9 09:56:04 EST 2009


Author: Alex.Kolonitsky
Date: 2009-11-09 09:56:04 -0500 (Mon, 09 Nov 2009)
New Revision: 15856

Added:
   branches/sandbox/3.3.X_JSF2/samples/calendar-sample/src/main/webapp/pages/RF-8071.jsp
Modified:
   branches/sandbox/3.3.X_JSF2/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
Log:
RF-8071 - Calendar: "NaN" is displayed for selected date


Added: branches/sandbox/3.3.X_JSF2/samples/calendar-sample/src/main/webapp/pages/RF-8071.jsp
===================================================================
--- branches/sandbox/3.3.X_JSF2/samples/calendar-sample/src/main/webapp/pages/RF-8071.jsp	                        (rev 0)
+++ branches/sandbox/3.3.X_JSF2/samples/calendar-sample/src/main/webapp/pages/RF-8071.jsp	2009-11-09 14:56:04 UTC (rev 15856)
@@ -0,0 +1,21 @@
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<%@ taglib uri="http://labs.jboss.com/jbossrichfaces/ui/calendar" prefix="rich" %>
+<html>
+<head>
+    <title>RF-8071 Calendar: "NaN" is displayed for selected date</title>
+</head>
+<body>
+<f:view>
+    <h:form id="f">
+        <rich:calendar
+                id="inputValidFrom"
+                datePattern="dd-MMM-yyyy"
+                showFooter="false"
+                required="true"
+                requiredMessage="msg.error_validFromNotEmpty" 
+                enableManualInput="true" />
+    </h:form>
+</f:view>
+</body>
+</html>
\ No newline at end of file

Modified: branches/sandbox/3.3.X_JSF2/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js
===================================================================
--- branches/sandbox/3.3.X_JSF2/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js	2009-11-09 13:36:23 UTC (rev 15855)
+++ branches/sandbox/3.3.X_JSF2/ui/calendar/src/main/resources/org/richfaces/renderkit/html/scripts/calendar.js	2009-11-09 14:56:04 UTC (rev 15856)
@@ -288,10 +288,16 @@
 	return value;
 };
 
-Richfaces.Calendar.getMonthByLabel = function (monthLabel, monthNames)
-{
-	var i=0;
-	while (i<monthNames.length) if (monthNames[i]==monthLabel) return i; else i++;
+Richfaces.Calendar.getMonthByLabel = function (monthLabel, monthNames) {
+    var i = 0;
+    while (i < monthNames.length) {
+        var toLowerMonthLabel = monthLabel.toLowerCase();
+        if (monthNames[i].toLowerCase() == toLowerMonthLabel) {
+            return i;
+        }
+        
+        i++;
+    }
 };
 
 Object.extend(Event, {
@@ -351,22 +357,17 @@
 	var re = /([.*+?^<>=!:${}()[\]\/\\])/g;
 	var monthNamesStr
 	var monthNamesShortStr;
-	if (!monthNames)
-	{
+	if (!monthNames) {
 		monthNames = Richfaces.Calendar.getDefaultMonthNames();
 		monthNamesStr = monthNames.join('|');
-	}
-	else
-	{
+	} else {
 		monthNamesStr = monthNames.join('|').replace(re, '\\$1');
 	}
-	if (!monthNamesShort)
-	{
+
+	if (!monthNamesShort) {
 		monthNamesShort = Richfaces.Calendar.getDefaultMonthNames(true);
 		monthNamesShortStr = monthNamesShort.join('|');
-	}
-	else
-	{
+	} else {
 		monthNamesShortStr = monthNamesShort.join('|').replace(re, '\\$1');
 	}
 	



More information about the richfaces-svn-commits mailing list