OFBiz
  1. OFBiz
  2. OFBIZ-4308

CalendarDateSelect Shows wrong selected date

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: Release Branch 10.04
    • Fix Version/s: None
    • Component/s: framework
    • Labels:
      None
    • Sprint:
      Bug Crush Event - 21/2/2015

      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

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Patch Available Patch Available
        1h 58m 1 Stephen Rufle 03/Jun/11 20:32
        Patch Available Patch Available Closed Closed
        3d 22h 42m 1 Jacques Le Roux 07/Jun/11 19:14
        Closed Closed Reopened Reopened
        28s 1 Jacques Le Roux 07/Jun/11 19:15
        Reopened Reopened Closed Closed
        1410d 15h 17m 1 Ashish Vijaywargiya 18/Apr/15 10:32
        Hide
        Jacques Le Roux added a comment -

        Yes indeed, calendar_date_select.js no longer exists, it has been replaced during the jQuery effort.

        Show
        Jacques Le Roux added a comment - Yes indeed, calendar_date_select.js no longer exists, it has been replaced during the jQuery effort.
        Ashish Vijaywargiya made changes -
        Status Reopened [ 4 ] Closed [ 6 ]
        Resolution Cannot Reproduce [ 5 ]
        Hide
        Ashish Vijaywargiya added a comment -

        We are unable to reproduce this issue on trunk and R14.12 so closing this. I think this was the issue in R10.04.

        Show
        Ashish Vijaywargiya added a comment - We are unable to reproduce this issue on trunk and R14.12 so closing this. I think this was the issue in R10.04.
        Sharan Foga made changes -
        Rank Ranked higher
        Sharan Foga made changes -
        Rank Ranked higher
        Sharan Foga made changes -
        Rank Ranked higher
        Sharan Foga made changes -
        Sprint Bug Crush Event - 21/2/2015 [ 91 ]
        Jacopo Cappellato made changes -
        Fix Version/s Release Branch 09.04 [ 12313602 ]
        Fix Version/s Release Branch 10.04 [ 12314832 ]
        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
        Jacques Le Roux made changes -
        Resolution Fixed [ 1 ]
        Status Closed [ 6 ] Reopened [ 4 ]
        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 :/
        Jacques Le Roux made changes -
        Status Patch Available [ 10002 ] Closed [ 6 ]
        Assignee Jacques Le Roux [ jacques.le.roux ]
        Fix Version/s Release Branch 09.04 [ 12313602 ]
        Fix Version/s Release Branch 10.04 [ 12314832 ]
        Resolution Fixed [ 1 ]
        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
        Jacques Le Roux made changes -
        Attachment screenshot-1.jpg [ 12481620 ]
        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
        Stephen Rufle made changes -
        Attachment OFBIZ-4308.patch [ 12481397 ]
        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
        Stephen Rufle made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Stephen Rufle made changes -
        Field Original Value New Value
        Attachment OrderPurchaseReportOptions-CalendarDateSelect.jpg [ 12481375 ]
        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
        Stephen Rufle created issue -

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development

                Agile