0 Replies Latest reply on Mar 9, 2007 9:51 AM by rmemoria

    s:selectDate render problem

    rmemoria

      Hi,

      I had no idea how to warn about bugs found+corrected in the source code, so I'm sending it here.

      A few posts ago I related a problem wiht the s:selectDate tag and the Romanian language. Acctually I found that the DateFormatSymbols.ShortWeekdays using the romanian locale returns strings with length of 1 char:

      D,L,Ma,Mi,J,V,S

      I checked the method ui.org.jboss.seam.ui.UISelectDate.commaSeparate and found a problem there:

      The code in use:

      private String commaSeparate(String[] values, int maxLength)
       {
       StringBuilder sb = new StringBuilder();
       for (String val : values)
       {
       if (!"".equals(val))
       {
       if (sb.length() > 0) sb.append(',');
       sb.append(maxLength == -1 ? val : val.substring(0, maxLength));
       }
       }
       return sb.toString();
       }


      I just replaced the
      sb.append(maxLength == -1 ? val : val.substring(0, maxLength));

      by

      sb.append((maxLength == -1) || (val.length() < maxLength) ? val : val.substring(0, maxLength));

      and now it's working fine.

      Best,
      Ricardo