1. #1
    Ext User
    Join Date
    Aug 2009
    Location
    City of Buenos Aires - Argentina
    Posts
    4
    Vote Rating
    0
    Carlos Ijelchuk is on a distinguished road

      0  

    Cool DatePicker in DateField returns one day less than selected

    DatePicker in DateField returns one day less than selected


    Hi all!!

    I think this is a BUG, anyone knows a workaround?

    when I click on a date, for example "Aug 28" in the corresponding field i'm getting "Aug 27", allways the same with Date Fields and DateTime Fields, I've also tryed to use differents DateTimeFormat.

    my code:


    Code:
    		final DateField Fecha = new DateField();
    		Fecha.setFormatValue(true);					
    		Fecha.getPropertyEditor().setFormat(DateTimeFormat.getMediumDateFormat());
    		Fecha.setFieldLabel("Fecha");
    		appForm.add(Fecha);
    		
    		final TimeField Inicio = new TimeField();		
    		Inicio.setFieldLabel("Inicio");						
    		appForm.add(Inicio);
    		
    		final TimeField Fin = new TimeField();
    		Fin.setFieldLabel("Fin");
    		appForm.add(Fin);
    when I try to read the value with this code:

    Code:
    Date FechaInicio = Fecha.getValue();
    I get the previous date than seleted.

    All suggestions are welcome!

    Carlos

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    It works without any problems with your sample for me. Also if this is really an issue many more people would have discovered it.

  3. #3
    Ext User
    Join Date
    Sep 2008
    Location
    Germany
    Posts
    961
    Vote Rating
    1
    Arno.Nyhm is on a distinguished road

      0  

    Default


    maybe it depends something on the timezones?
    This forum needs your help: you got hints from the community and now you have fixed your code? dont just reply with "now its fixed" or "i found the error"! please take the time to post also an detailed answer with the working code.

    GreaseMonkey Script for a GXT-only Forum: it hides ExtJs here: New Posts • Search Results • Advanced Search form • Category overview http://www.extjs.com/forum/showthrea...041#post410041

  4. #4
    Ext User
    Join Date
    Aug 2009
    Location
    City of Buenos Aires - Argentina
    Posts
    4
    Vote Rating
    0
    Carlos Ijelchuk is on a distinguished road

      0  

    Default


    I'm using TimeZone -3 GMT for Buenos Aires (Argentina), is that the problem? how can I solve it?

    thanks in advance for your help.

    Carlos

  5. #5
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Also works without any problems with that locale for me

  6. #6
    Ext User
    Join Date
    Aug 2009
    Location
    City of Buenos Aires - Argentina
    Posts
    4
    Vote Rating
    0
    Carlos Ijelchuk is on a distinguished road

      0  

    Default


    Sven and Arno.Nyhm, I found out what the problem is.. the problem occurs only with the Hosted Mode, after compiling and test the feature on a regular browser (chrome, FireFox and IE) i've see the problem.

    thanks again for your help!

    Carlos

  7. #7
    Sencha User
    Join Date
    Feb 2011
    Posts
    1
    Vote Rating
    0
    user001 is on a distinguished road

      0  

    Default


    I have issue like this. When user select some date in DateField with DatePicker, for example 10 Aug 2011 then method DateField.getValue() return 09 Aug 2011 22:00:00, ie it subtracts from the date timezone of user (UTC+2 in this example).

  8. #8
    Ext GWT Premium Member
    Join Date
    Apr 2010
    Posts
    13
    Vote Rating
    0
    tcozien is on a distinguished road

      0  

    Default


    Hi,

    I have the same issue. I don't know how to fix it...
    It appears only on certain dates (ie 20/02/1932 -> 19/02/1932 whereas 20/02/1998 -> 20/02/1998)

    Any help?

  9. #9
    Sencha User
    Join Date
    Apr 2011
    Posts
    2
    Vote Rating
    0
    franciscotbjr is on a distinguished road

      0  

    Default daylight saving time bug

    daylight saving time bug


    I've found that this issue is due to windows (in my case) self adjustment to daylight saving time (horário de verão in portuguese) witch here in Brazil represents one hour ahead. If we turn off windows self adjustment to daylight saving, than it works again.

    The question is I have just found it and I am still working in a solution.

  10. #10
    Sencha User
    Join Date
    Apr 2011
    Posts
    2
    Vote Rating
    0
    franciscotbjr is on a distinguished road

      0