Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-3025

DateTextField converter does not honor current locale

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 1.4.10
    • 1.4.11, 1.5-M2.1
    • wicket-extensions
    • None

    Description

      I think there is a small bug in
      org.apache.wicket.extensions.markup.html.form.DateTextField.
      A DateConverter is created in the constructor:

      converter = new DateConverter()
      {
      private static final long serialVersionUID = 1L;

      /**

      • @see org.apache.wicket.util.convert.converters.DateConverter#getDateFormat(java.util.Locale)
        */
        @Override
        public DateFormat getDateFormat(Locale locale) { return new SimpleDateFormat(DateTextField.this.datePattern); }

        };

      But I think getDateFormat(...) method should looks like:

      @Override
      public DateFormat getDateFormat(Locale locale)
      {
      if (locale == null)

      { locale = Locale.getDefault(); }

      return new SimpleDateFormat(DateTextField.this.datePattern. locale);
      }

      Attachments

        Activity

          People

            ivaynberg Igor Vaynberg
            interface Daniel Stoch
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: