Page 3 of 3 FirstFirst 123
Results 21 to 24 of 24

Thread: DateField: I picked up 11/29/2007, but field receive 28/11/2007

  1. #21
    Sencha User
    Join Date
    Oct 2008
    Location
    S
    Posts
    24
    Vote Rating
    0
      0  

    Default

    Hello!!

    where i need add this code? i'm using ext-2.2!

    Code:
    Ext.form.DateField.prototype.menuListeners.select = function(m, d) {
    	this.setValue(d);                 
    	this.fireEvent('dateselect');
    }
    Date.prototype.clearTime = function(clone){
         if(clone){
        	return this.clone().clearTime();
        }
    
        if(this.getHours() == 23){
        	this.setTime(this.getTime()+(3600000));
        }else{
        	this.setHours(0);
        }
        
        this.setMinutes(0);
        this.setSeconds(0);
        this.setMilliseconds(0);
        return this;
    };

  2. #22
    Sencha User
    Join Date
    Apr 2007
    Posts
    22
    Vote Rating
    0
      0  

    Default

    Lombras,

    This is an override to Ext's functions, so you should add this code to your project's javascript files, after the Ext library has been loaded. There's no need to modify the Ext library.

  3. #23
    Sencha User mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
      0  

    Default

    [ follow-up ]
    here's a list of changes i'm proposing for Ext 2.2.1's DatePicker / Date which should do the trick for 1.x too as the DatePicker / Date codes haven't changed much since 1.x:
    https://www.sencha.com/forum/showthread.php?p=302310

    turns out it required a combination of both UTC format hour / minutes / seconds / milliseconds, a tiny change to clearTime()'s internals, and an additional check for DST to resolve the matter (see link for more details).

    the reason why most of us in non-DST / english locales can't reproduce the problem on WinXP is that the DST timezones aren't automatically updated (requires a registry patch from m$).

  4. #24
    Sencha User
    Join Date
    Jun 2011
    Location
    Chicago, IL
    Posts
    6
    Vote Rating
    0
      0  

    Default

    I had the same problem. It turns out that if the date value in an Ext.data.Model is timezone unaware, then Firefox 6.0.2 converts the time to the client's timezone when loading data. I am in CST and therefore some dates appear to be the day before.

    Picking and submitting dates worked fine. However, when the data is reloaded from the database the value is timezone unaware (e.g. '1972-10-29'). Instead of assuming UTC, in Firefox 6.0.2, the date is parsed and converted to the client timezone.

    I was able to fix the problem by changing my Ext.data.Model configuration
    FROM: {name: 'dob', type: 'date'},TO: {name: 'dob'},

Page 3 of 3 FirstFirst 123

Posting Permissions

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