Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-5850

<@htmlTemplate.renderDateTimeField does not parse date string based on input format

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: Release Branch 13.07, Trunk
    • Fix Version/s: 14.12.01, 12.04.06, 13.07.02
    • Component/s: None
    • Labels:
      None

      Description

      Commit 1626419 changed htmlFormMacroLibrary.ftl renderDateTimeField to use Date.parse instead of Date.parseExact.

      https://code.google.com/p/datejs/wiki/APIDocumentation states Date.parse will use current CultureInfo for formats but for parsing ISO yyyy-MM-dd from hidden field, need to use parseExact.

      I spotted this when CultureInfo was en-GB and selecting 2014-11-01 on any date field (i18n field displays 11/01/2014 instead of 01/11/2014)

      For November all days after the 12th display correctly

      1. 1637919.patch
        3 kB
        Gareth Carter

        Issue Links

          Activity

          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Thanks Gareth well spotted,

          Your slightly mofidied patch is in
          trunk r1641066
          R13.07 r1641068
          R12.04 r1641069

          I simply removed the line added in the block which remove the dot and 000 ms in date/time string. I did not see any reason why this was needed. I modified the comment on this block for faster understanding.

          Show
          jacques.le.roux Jacques Le Roux added a comment - Thanks Gareth well spotted, Your slightly mofidied patch is in trunk r1641066 R13.07 r1641068 R12.04 r1641069 I simply removed the line added in the block which remove the dot and 000 ms in date/time string. I did not see any reason why this was needed. I modified the comment on this block for faster understanding.
          Hide
          gareth.carter Gareth Carter added a comment -

          Thanks Jacques.

          The code to remove the ms was something else I was testing and snuck into that patch, apologies for that.

          However, I do believe removing the ms is valid because it prevents the jquery datetimepicker from setting the time in the popup from an existing value. For this I will create another jira.

          Show
          gareth.carter Gareth Carter added a comment - Thanks Jacques. The code to remove the ms was something else I was testing and snuck into that patch, apologies for that. However, I do believe removing the ms is valid because it prevents the jquery datetimepicker from setting the time in the popup from an existing value. For this I will create another jira.
          Hide
          jacques.le.roux Jacques Le Roux added a comment -

          Note:this issue is OFBIZ-5883

          Show
          jacques.le.roux Jacques Le Roux added a comment - Note:this issue is OFBIZ-5883

            People

            • Assignee:
              jacques.le.roux Jacques Le Roux
              Reporter:
              gareth.carter Gareth Carter
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development