OFBiz
  1. OFBiz
  2. OFBIZ-4308

CalendarDateSelect Shows wrong selected date

    Details

      Description

      When a date value is initially specified ex.2011-05-03 and then the calendar is popped open the date is off by one.

        Activity

        Hide
        Jacques Le Roux added a comment -

        Any update?

        Show
        Jacques Le Roux added a comment - Any update?
        Hide
        Jacques Le Roux added a comment -

        Stephen,

        You convinced me, I tried the change and using either 2005-05-03 or 2005/05/03 it worked. I then commited your change (without the

        -    // mod for ofbiz 
        +    // mod for ofbiz
        

        part) at r1133111.

        But then I just had a doubt about the slash used in date and I suddenly remembered that we need also to handle time in such fields. And this change breaks it. For instance try to add 20:00:00.000 after the date... (using either 2005-05-03 or 2005/05/03). So it needs more work...

        Reverted at r1133119

        Show
        Jacques Le Roux added a comment - Stephen, You convinced me, I tried the change and using either 2005-05-03 or 2005/05/03 it worked. I then commited your change (without the - // mod for ofbiz + // mod for ofbiz part) at r1133111. But then I just had a doubt about the slash used in date and I suddenly remembered that we need also to handle time in such fields. And this change breaks it. For instance try to add 20:00:00.000 after the date... (using either 2005-05-03 or 2005/05/03). So it needs more work... Reverted at r1133119
        Hide
        Jacques Le Roux added a comment -

        Another time got by this damned cancel button :/

        Show
        Jacques Le Roux added a comment - Another time got by this damned cancel button :/
        Hide
        Stephen Rufle added a comment -

        I did a fresh checkout of http://svn.apache.org/repos/asf/ofbiz/branches/release10.04
        ant run-install
        startofbiz.bat
        Changed to "Flat Grey" theme (I am sure it happens with any theme)

        https://localhost:8443/ordermgr/control/OrderPurchaseReportOptions

        Enter 2011-05-03 in "Sales by Store Report" > "From Date"
        Pop Open calendar (see wrong date selected)

        In the firebug console, this is where I saw the issue most clearly
        BAD: new Date("2011-05-03") -> Date

        {Mon May 02 2011 17:00:00 GMT-0700 (US Mountain Standard Time)}

        GOOD: new Date("2011/05/03") -> Date

        {Tue May 03 2011 00:00:00 GMT-0700 (US Mountain Standard Time)}

        You may not see the issue because your time offset from GMT is enough that when you do the testing you fall on the correct day <shrug>.

        Show
        Stephen Rufle added a comment - I did a fresh checkout of http://svn.apache.org/repos/asf/ofbiz/branches/release10.04 ant run-install startofbiz.bat Changed to "Flat Grey" theme (I am sure it happens with any theme) https://localhost:8443/ordermgr/control/OrderPurchaseReportOptions Enter 2011-05-03 in "Sales by Store Report" > "From Date" Pop Open calendar (see wrong date selected) In the firebug console, this is where I saw the issue most clearly BAD: new Date("2011-05-03") -> Date {Mon May 02 2011 17:00:00 GMT-0700 (US Mountain Standard Time)} GOOD: new Date("2011/05/03") -> Date {Tue May 03 2011 00:00:00 GMT-0700 (US Mountain Standard Time)} You may not see the issue because your time offset from GMT is enough that when you do the testing you fall on the correct day <shrug>.
        Hide
        Jacques Le Roux added a comment -

        Also note that I use a French system, sets as a French system

        Show
        Jacques Le Roux added a comment - Also note that I use a French system, sets as a French system
        Hide
        Jacques Le Roux added a comment -

        BTW the only changes I got when goipng back to r1104428 were these,

        Command: Update
        Updated: D:\workspace\release10.04\framework\widget\templates\xmlFormMacroLibrary.ftl text/plain
        Updated: D:\workspace\release10.04\framework\widget\templates\foFormMacroLibrary.ftl text/plain
        Updated: D:\workspace\release10.04\framework\widget\templates\textFormMacroLibrary.ftl text/plain
        Updated: D:\workspace\release10.04\framework\widget\templates\csvFormMacroLibrary.ftl text/plain
        Updated: D:\workspace\release10.04\framework\service\src\org\ofbiz\service\ServiceDispatcher.java text/plain
        Updated: D:\workspace\release10.04\framework\entity\src\org\ofbiz\entity\Delegator.java text/plain
        Updated: D:\workspace\release10.04\framework\entity\src\org\ofbiz\entity\GenericDelegator.java text/plain
        Updated: D:\workspace\release10.04\specialpurpose\pos\config\xpos.properties text/plain
        Updated: D:\workspace\release10.04
        Completed: At revision: 1104428

        Show
        Jacques Le Roux added a comment - BTW the only changes I got when goipng back to r1104428 were these, Command: Update Updated: D:\workspace\release10.04\framework\widget\templates\xmlFormMacroLibrary.ftl text/plain Updated: D:\workspace\release10.04\framework\widget\templates\foFormMacroLibrary.ftl text/plain Updated: D:\workspace\release10.04\framework\widget\templates\textFormMacroLibrary.ftl text/plain Updated: D:\workspace\release10.04\framework\widget\templates\csvFormMacroLibrary.ftl text/plain Updated: D:\workspace\release10.04\framework\service\src\org\ofbiz\service\ServiceDispatcher.java text/plain Updated: D:\workspace\release10.04\framework\entity\src\org\ofbiz\entity\Delegator.java text/plain Updated: D:\workspace\release10.04\framework\entity\src\org\ofbiz\entity\GenericDelegator.java text/plain Updated: D:\workspace\release10.04\specialpurpose\pos\config\xpos.properties text/plain Updated: D:\workspace\release10.04 Completed: At revision: 1104428
        Hide
        Jacques Le Roux added a comment -

        Sorry again, I tried with the same revision, same language, same theme and I use also FF4 and I still don't reproduce (see screenshot-1)

        It would be interesting ot have other persons tests

        Show
        Jacques Le Roux added a comment - Sorry again, I tried with the same revision, same language, same theme and I use also FF4 and I still don't reproduce (see screenshot-1) It would be interesting ot have other persons tests
        Hide
        Stephen Rufle added a comment -

        r1104428
        http://svn.apache.org/repos/asf/ofbiz/branches/release10.04

        I definitely see the issue as per the image. I have tracked it to how new Date(string) creates a date. Having said that I am using FF4, not sure that should make a difference.

        Show
        Stephen Rufle added a comment - r1104428 http://svn.apache.org/repos/asf/ofbiz/branches/release10.04 I definitely see the issue as per the image. I have tracked it to how new Date(string) creates a date. Having said that I am using FF4, not sure that should make a difference.
        Hide
        Jacques Le Roux added a comment -

        Sorry Stephen,

        Which revision are you using: I don't reproduce with latest

        Show
        Jacques Le Roux added a comment - Sorry Stephen, Which revision are you using: I don't reproduce with latest
        Hide
        Stephen Rufle added a comment -

        Changing the standard '-' to a '/' and then letting parseFormattedString be called seems to fix the issue locally

        Show
        Stephen Rufle added a comment - Changing the standard '-' to a '/' and then letting parseFormattedString be called seems to fix the issue locally
        Hide
        Stephen Rufle added a comment -

        This shows the issue. I entered 2011-05-03, the image shows 2011-05-02 selected

        Show
        Stephen Rufle added a comment - This shows the issue. I entered 2011-05-03, the image shows 2011-05-02 selected

          People

          • Assignee:
            Jacques Le Roux
            Reporter:
            Stephen Rufle
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:

              Development