myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1748577 - /myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/DateRenderer.java
Date Wed, 15 Jun 2016 12:52:02 GMT
Author: lofwyr
Date: Wed Jun 15 12:52:02 2016
New Revision: 1748577

URL: http://svn.apache.org/viewvc?rev=1748577&view=rev
Log:
TOBAGO-1483: Date Picker
* fix missing icon, when there is no pattern.

Modified:
    myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/DateRenderer.java

Modified: myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/DateRenderer.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/DateRenderer.java?rev=1748577&r1=1748576&r2=1748577&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/DateRenderer.java
(original)
+++ myfaces/tobago/trunk/tobago-theme/tobago-theme-standard/src/main/java/org/apache/myfaces/tobago/renderkit/html/standard/standard/tag/DateRenderer.java
Wed Jun 15 12:52:02 2016
@@ -87,10 +87,13 @@ public class DateRenderer extends InRend
     writer.writeAttribute(HtmlAttributes.TYPE, HtmlButtonTypes.BUTTON);
     writer.writeAttribute(HtmlAttributes.DISABLED, date.isDisabled() || date.isReadonly());
 
-    if (StringUtils.containsAny(pattern, "yYMDdE")) {
+    final boolean hasDate = StringUtils.containsAny(pattern, "yYMDdE");
+    final boolean hasTime = StringUtils.containsAny(pattern, "Hhms");
+
+    if (hasDate || !hasTime) { //  || !hasTime is, to have at least one icon
       writer.writeIcon(Icons.CALENDAR);
     }
-    if (StringUtils.containsAny(pattern, "Hhms")) {
+    if (hasTime) {
       writer.writeIcon(Icons.CLOCK_O);
     }
 



Mime
View raw message