You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lo...@apache.org on 2010/06/21 09:05:08 UTC

svn commit: r956468 - in /myfaces/tobago/branches/tobago-1.0.x: example/demo/src/main/webapp/reference/time.jsp theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/calendar.js

Author: lofwyr
Date: Mon Jun 21 07:05:07 2010
New Revision: 956468

URL: http://svn.apache.org/viewvc?rev=956468&view=rev
Log:
TOBAGO-894: Support date pattern "MM.yyyy" for <tx/tc:date>

Modified:
    myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/webapp/reference/time.jsp
    myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/calendar.js

Modified: myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/webapp/reference/time.jsp
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/webapp/reference/time.jsp?rev=956468&r1=956467&r2=956468&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/webapp/reference/time.jsp (original)
+++ myfaces/tobago/branches/tobago-1.0.x/example/demo/src/main/webapp/reference/time.jsp Mon Jun 21 07:05:07 2010
@@ -28,7 +28,7 @@
   <jsp:body>
       <tc:box label="Time Specific Controls">
         <f:facet name="layout">
-          <tc:gridLayout columns="400px;*" rows="fixed;fixed;fixed;fixed;fixed;fixed;fixed;250px;*"/>
+          <tc:gridLayout columns="400px;*" rows="fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;fixed;250px;*"/>
         </f:facet>
         <%-- code-sniplet-start id="date" --%>
         <tx:date label="Date" value="#{now}">
@@ -69,6 +69,16 @@
         </tx:date>
         <tc:cell/>
 
+        <tx:date label="Month" value="#{now}">
+          <f:convertDateTime pattern="MMMMM yyyy"/>
+        </tx:date>
+        <tc:cell/>
+
+        <tx:date label="Year" value="#{now}">
+          <f:convertDateTime pattern="yyyy"/>
+        </tx:date>
+        <tc:cell/>
+
         <%-- code-sniplet-start id="calendar" --%>
         <tc:calendar />
         <%-- code-sniplet-end id="calendar" --%>
@@ -78,4 +88,4 @@
 
       </tc:box>
   </jsp:body>
-</layout:overview>
\ No newline at end of file
+</layout:overview>

Modified: myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/calendar.js
URL: http://svn.apache.org/viewvc/myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/calendar.js?rev=956468&r1=956467&r2=956468&view=diff
==============================================================================
--- myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/calendar.js (original)
+++ myfaces/tobago/branches/tobago-1.0.x/theme/scarborough/src/main/resources/org/apache/myfaces/tobago/renderkit/html/scarborough/standard/script/calendar.js Mon Jun 21 07:05:07 2010
@@ -209,6 +209,9 @@ function initCalendarParse(id, textBoxId
   var date = new Date(getDateFromFormat(string, document.calendar.formatPattern));
   if (date.getTime() == 0) {
     date = new Date();
+  } else if (! document.calendar.formatPattern.match(/d/)) {
+    // XXX Workaround for patterns without day (d) like mm/yyyy (repair the result from parsing)
+    date.setDate(date.getDate() + 1);
   }
   var day = date.getDate();
   var month = date.getMonth() + 1;