Uploaded image for project: 'Tapestry'
  1. Tapestry
  2. TAPESTRY-1105

DropdownDatePicker.java uses wrong format to pass date value to DoJo

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 4.1.1
    • 4.1.1
    • JavaScript, tapestry-core
    • None

    Description

      Line 85 of DropdownDatePicker.java:

      json.put("date", getTranslatedFieldSupport().format(this, getValue()));

      however, this generates these errors in the browser from DoJo:

      DEBUG: invalid date string: 10/02/06
      DEBUG: DEPRECATED: dojo.widget.DropdownDatePicker date attributes must be passed in Rfc3339 format – will be removed in version: 0.5

      This is because I defined a custom Translator for the field. It is picking up it's format string for the parse/validation phase, but the date value is the initial displayed value used when generating the text box, and needs to be in "yyyy-MM-dd" format.

      When changing this, don't use a static DateFormat, of course, as they aren't thread safe. Been bitten by that before - took a serious debug effort to track that one down. You can use an Object pool or ThreadLocal, however.

      Attachments

        Activity

          People

            jkuhnert Jesse Kuhnert
            gwoolsey Greg Woolsey
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: