Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-1762

DateFormatTransformer does not work correctly with non-default locale dates

Agile BoardAttach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 1.5
    • Labels:
      None
    • Environment:

      Different locale in the imported data.

      Description

      The DateFormatTransformer assumes the default locale for date transformations.
      If your computer or server has its language set to 'es' and the input file has "November 30, 2009", it'll throw an exception.

      Here's a reproducible test case:
      Define an XML file:
      <awardlist><award><expirationdate>November 30, 2009</expirationdate></award></awardlist>

      Define the data-config.xml with:
      <field column="expirationdate_dt" xpath="/awardslist/award/expirationdate" dateTimeFormat="MMMMM dd, yyyy" />

      It'll throw:
      Exception in thread "main" java.text.ParseException: Unparseable date: "November 30, 2009"

        Attachments

          Activity

            People

            • Assignee:
              noble.paul Noble Paul
              Reporter:
              tcc tommy chheng

              Dates

              • Created:
                Updated:
                Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1h
              1h
              Remaining:
              Remaining Estimate - 1h
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Issue deployment