Page 1 of 6 123 ... LastLast
Results 1 to 10 of 60

Thread: [CLOSED-35] [3.x/2.x] DatePicker Picks wrong date

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1

    Default [CLOSED-35] [3.x/2.x] DatePicker Picks wrong date

    Hi,
    When you pick 22 and 23 th march of 2009, the picker shows 21 of march, and for dates after that, there is always 1 day difference. for example if you pick 29th, Field value would be 03/28/2009. You can find a Simple runnable DateField here:

    http://www.extjs.com/deploy/dev/exam...dv-vtypes.html

    I traced the source and I got to here:

    ext 2.2
    ext-2.2\source\widgets\DatePicker.js
    @class Ext.DatePicker
    line 666 - 686

    Sometimes d.setDate(d.getDate()+1); doesn't add a day!! I know it's weird, but it happens!! Actually this kind of problem occurs in many days. Above example is only one of them. I am using
    Windows XP,
    FF3, IE7

    Hope to hear from you guys soon.
    Thanks

  2. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,250

    Default

    Can't replicate it using the online examples. Anyone else?
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  3. #3
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    i've seen this reported before, but it's never been 100% reproducible.

    @sina: what's your computer's locale setting?
    do your friends / colleagues experience the same problem?
    can you reproduce the problem on other browsers (e.g. chrome / safari / opera)?
    is there some sort of daylight savings thing going on in your part of the world?

  4. #4
    Ext JS Premium Member
    Join Date
    Jan 2009
    Posts
    22

    Default

    I don't know about the 1-day-difference bug.
    But I know that there is a bug in the validation code in the sample page.

    http://extjs.com/forum/showthread.php?t=62176
    raj

  5. #5

    Default How to see the error

    Great tips from mystix,
    If you want to see the bug:
    • Go to Date and Time in control panel
    • In the timezone select (GMT +03:30) Tehran (I don't know about other time zones, but it work fine for "Canada&US")
    • Tick the check box: "Automatically adjust clock for daylight saving changes"
    • Restart windows
    • Go to online examples that contain DateField
    Thanks a lot for quick responses

  6. #6
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    Quote Originally Posted by Sina View Post
    Great tips from mystix,
    If you want to see the bug:
    • Go to Date and Time in control panel
    • In the timezone select (GMT +03:30) Tehran (I don't know about other time zones, but it work fine for "Canada&US")
    • Tick the check box: "Automatically adjust clock for daylight saving changes"
    • Restart windows
    • Go to online examples that contain DateField
    Thanks a lot for quick responses
    followed the steps you outlined above on a virtual image of WinXP SP3 machine running FF3.0.5, using the following example:
    http://www.extjs.com/deploy/dev/exam.../xml-form.html

    works correctly for me.

    i also fired up the Firebug console and typed new Date(); into the console just to make sure, and it gave me this:
    Code:
    Tue Mar 10 2009 18:39:33 GMT+0430 (Iran Daylight Time)
    is there anything else i'm missing?

    p.s. what was the exact Tehran time when you tried the example?

  7. #7

    Default Don't use Virtual Machine

    Hi and thanks again for your time mystix,
    I had an idea, there is a slight chance, that you don't see the bug on virtual machines. So I installed Microsoft Virtual PC, set up Win XP on that, and there was no error. It is really appreciated if you test it on a real Win XP.

    All my colleagues have the same problem when that check box is checked. The bug also happens in chrome and opera. And I also don't think it's a matter of time, because I am working from 8 am to 8 pm and there is no sign of a working DateField!

    Thanks a lot

  8. #8

    Default No answer?!

    I was getting used to quick responses, but it seems there is no more!
    Is there someone working on this issue?

  9. #9
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    calm down calm down...

    apply this override in your local environment:
    Code:
    Ext.apply(Date.prototype, {
        isDST: function() {
            // adapted from http://extjs.com/forum/showthread.php?p=247172#post247172
            // courtesy of @geoffrey.mcgill
            return new Date(this.getFullYear(), 0, 1).getTimezoneOffset() != this.getTimezoneOffset();
        }
    });
    and then run this in the firebug console:
    Code:
    (new Date()).isDST();
    and tell me if that returns true or false. nevermind. i switched my date time settings like you've recommended and verified that this works.



    next, pick march 23rd 2009 using this example: http://extjs.com/deploy/dev/examples/form/xml-form.html,
    then open up firebug for that page and type this into the firebug console:

    Code:
    Ext.getCmp(Ext.get('form-ct').first().id).find('name', 'dob')[0].getValue()
    and post the resulting date string.


    and lastly, check if clicking the "Today" button in the datepicker ever returns the incorrect date.


    [update]
    i've changed my date-time settings on a real WinXP SP3 machine as you've suggested in post #5 but i'm still unable to reproduce the problem. the dates i pick are displayed correctly in the datefield's <input> field. still trying to find ways to reproduce your reported problem.
    Last edited by mystix; 12 Mar 2009 at 4:14 AM. Reason: see below post

  10. #10
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236

    Default

    @sina,

    i've tried the following (after setting my date-time settings as detailed by @sina in post #5):
    • with my windows calendar set to today, picking 22 / 23 march and the dates beyond
    • setting my windows calendar to 28th Feb 2009 (because, according to Firefox 3.0.7, DST in tehran starts at 3am, march 1, 2009. DST in tehran ends at 12am, Sept 23, 2009. but the links i mentioned at the end of this post say otherwise), then picking march 22 and 23, and dates beyond

    both of which return correct results.

    could you post a complete drop in html test page? (what i'd really like to see are your script includes)


    also, what is your WinXP machine's region / location (under Control Panel > Regional and Language Options) set to?
    (and what were these settings in your virtual PC?)[/s]


    [update 1]
    found the following 2 links, which hint at what might be going wrong:
    http://www.timeanddate.com/worldcloc...one.html?n=246
    http://www.timeanddate.com/worldcloc...=246&year=2009
    could you please verify the information?


    [update 2]
    i also found this: http://support.microsoft.com/kb/914387
    attempting to update my settings now.

    [update 3]
    updated timezone settings. i'm now finally able to see the problem as described by @sina. the timezone update registry patch provided my microsoft did the trick.
    Last edited by mystix; 12 Mar 2009 at 5:32 AM. Reason: update

Page 1 of 6 123 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •