You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ca...@apache.org on 2008/10/21 16:20:55 UTC

svn commit: r706636 - /myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/date/AbstractHtmlInputDate.java

Author: cagatay
Date: Tue Oct 21 07:20:54 2008
New Revision: 706636

URL: http://svn.apache.org/viewvc?rev=706636&view=rev
Log:
fix for TOMAHAWK-1361, ignore, hour, minute, seconds and milliseconds when the type for inputDate has nothing to do with time and only deals with date info

Modified:
    myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/date/AbstractHtmlInputDate.java

Modified: myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/date/AbstractHtmlInputDate.java
URL: http://svn.apache.org/viewvc/myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/date/AbstractHtmlInputDate.java?rev=706636&r1=706635&r2=706636&view=diff
==============================================================================
--- myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/date/AbstractHtmlInputDate.java (original)
+++ myfaces/tomahawk/trunk/core/src/main/java/org/apache/myfaces/custom/date/AbstractHtmlInputDate.java Tue Oct 21 07:20:54 2008
@@ -138,6 +138,13 @@
                     tempCalendar.set(Calendar.DAY_OF_MONTH,Integer.parseInt(day));
                     tempCalendar.set(Calendar.MONTH,Integer.parseInt(month)-1);
                     tempCalendar.set(Calendar.YEAR,Integer.parseInt(year));
+                    if( !type.equals("full")) {
+                    	tempCalendar.set(Calendar.HOUR_OF_DAY, 0);
+                    	tempCalendar.set(Calendar.MINUTE, 0);
+                    	tempCalendar.set(Calendar.SECOND, 0);
+                    	tempCalendar.set(Calendar.MILLISECOND, 0);
+                    	return new java.sql.Date(tempCalendar.getTimeInMillis());
+                    }
                 }
 
                 if(! type.equals( "date" )) {