Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    DateItem issue

    Hi,

    I have following test case:

    final DateItem date = new DateItem("test");
    date.setUseTextField(true);
    IButton btn = new IButton("test");
    btn.addClickHandler(new ClickHandler() {
    @Override
    public void onClick(ClickEvent event) {
    SC.say(date.getValueAsDate().toString());
    }
    });
    DynamicForm form = new DynamicForm();
    form.setFields(date);
    VLayout layout = new VLayout();
    layout.setMembers(form, btn);
    layout.draw();


    When I enter the date "10/30/1978" (or later) and click test I get "Mon Oct 30 00:00:00 CET 1978".
    When I enter the date "10/29/1978" (or earlier) and click test I get "Sat Oct 28 23:00:00 CET 1978".

    What's the problem ?

    thank you.

    #2
    Hello,

    I already have this issue, see my post : http://forums.smartclient.com/showthread.php?t=10766


    When I updated to SmartGWT 2.3 and GWT 2.2, no more problems...

    Comment


      #3
      Originally posted by Psidoler
      Hello,

      I already have this issue, see my post : http://forums.smartclient.com/showthread.php?t=10766


      When I updated to SmartGWT 2.3 and GWT 2.2, no more problems...
      Hello,

      I'm using smartGWT 2.5 and GWT 2.2

      Comment


        #4
        You're calling toString() on a Date. We don't control that API, but we do control what would happen if you formatted it using our formatters or displayed it in a component. Try those scenarios and let us know if you see a problem.

        Comment


          #5
          Originally posted by Isomorphic
          You're calling toString() on a Date. We don't control that API, but we do control what would happen if you formatted it using our formatters or displayed it in a component. Try those scenarios and let us know if you see a problem.
          When I use GWT DateTimeFormat, the result is the same.
          DateTimeFormat formatter = DateTimeFormat.getFormat("dd.MM.yyyy HH:mm");
          SC.say(formatter.format(date.getValueAsDate()));

          or which "your" formatter should I use for test ?
          It seems that getValueAsDate on DateItem is returning wrong date...
          Last edited by jchajdiak; 19 May 2011, 13:00.

          Comment


            #6
            We're not reproducing this issue using Firefox 4.0, GWT 2.2
            Can you verify exactly which version of SGWT you're using (nightly build date) and what browser, OS / any other config.
            Also do you see this issue just in development mode (IE if you run GWT-compile and hit the application without the ?gwt.codesvr=... parameter do you still see the bug)?
            Thanks

            Comment


              #7
              One more question - what locale / timezone is your browser in?
              Thanks

              Comment


                #8
                Originally posted by Isomorphic
                One more question - what locale / timezone is your browser in?
                Thanks
                My system/browser uses Central European Summer Time which is UTC+2.

                Comment


                  #9
                  Originally posted by Isomorphic
                  We're not reproducing this issue using Firefox 4.0, GWT 2.2
                  Can you verify exactly which version of SGWT you're using (nightly build date) and what browser, OS / any other config.
                  Also do you see this issue just in development mode (IE if you run GWT-compile and hit the application without the ?gwt.codesvr=... parameter do you still see the bug)?
                  Thanks
                  I experienced this problem in FF4 and IE8.
                  smartgwt pro 2.5 built 2011-05-08
                  gwt 2.2
                  development mode and also compiled with no difference

                  Comment


                    #10
                    Can you retest with the latest nightly - we've resolved an issue where this could happen in specific locales where the DST switchover occurs as midnight.

                    Comment


                      #11
                      Originally posted by Isomorphic
                      Can you retest with the latest nightly - we've resolved an issue where this could happen in specific locales where the DST switchover occurs as midnight.
                      hi,
                      i've tested it and it's ok now.
                      The only strange thing is, that if I use the same test as in top of this thread and enter the date "10/29/1978" I get "Sun Oct 29 12:00:00 CET 1978".
                      I think the time part should be 00:00:00, but when I use only date, it's ok.

                      Comment


                        #12
                        We had to change the internal representation of the time portion for a pure "date" value from midnight to noon. The reason is that because Brazil switched to DST on midnight Nov 29 2003, there was no midnight on that day in Brazil. All components will ignore the time portion when displaying a "date" value so you don't need to worry about it.

                        Comment


                          #13
                          Originally posted by Isomorphic
                          We had to change the internal representation of the time portion for a pure "date" value from midnight to noon. The reason is that because Brazil switched to DST on midnight Nov 29 2003, there was no midnight on that day in Brazil. All components will ignore the time portion when displaying a "date" value so you don't need to worry about it.
                          Hi,

                          after some more tests I'm experiencing some new date(Time)Item related problems.

                          First - when I click on calendar component, february is missing...
                          Second - when I use calendar to select date, I always get selected date + one day to date(time) field.

                          Comment


                            #14
                            How did you get from "it's OK now" to the date being always wrong? Consider what you've changed. If you think theres a framework problem, put together a standalone test case and also indicate timezone/location and exact date value chosen and by what means.

                            Comment


                              #15
                              Originally posted by Isomorphic
                              How did you get from "it's OK now" to the date being always wrong? Consider what you've changed. If you think theres a framework problem, put together a standalone test case and also indicate timezone/location and exact date value chosen and by what means.
                              ok...
                              the former problem was something else...and it was fixed...

                              now the problems are related to calendar component. Using following test case:

                              final DateItem date = new DateItem("test");
                              date.setUseTextField(true);
                              DynamicForm form = new DynamicForm();
                              form.setFields(date);
                              form.draw();

                              1. there are missing months in calendar component -february, april, june, september, november (see attached image)
                              2. when setting date (any) by selecting from calendar component, the result is selected date + 1 day

                              smartgwt pro 2.5 built 2011-05-29
                              IE8, FF4, Chrome10
                              timezone CEST (UTC+2)
                              Attached Files

                              Comment

                              Working...
                              X