Announcement

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

    Dealing with Daylight Saving; preventing the correction in DateTimeItem

    Hello,

    Using SmartGWT 3.0 Power.

    I am building a little scheduling module in my app to schedule lectures.
    When I use a datepicker to select a time beyond 25th of march, when Daylight Savings Time starts (Netherlands, which is GMT+1 or CET), and I pick say 10:00 am, upon blur the item corrects to 09:00am (a refocus and reblur will make it count down to 8am, 7am, etc.).

    How can I prevent this correction, and completely ignore the matter?

    The thing is, if I want to schedule a lecture at 09:00 am in June, I don't care what DST paradigm is being used, a teacher should just be able to see that he needs to be there at 9am.

    So, I see how this feature can be useful, but for my particular case it is not.

    Oh yes, I use a MySQL backend, where the particular field is of type DATETIME.

    Any thoughts on how to deal with these things properly?

    #2
    My timezone is GMT+1, and i already tried
    Code:
     DateUtil.setAdjustForDST(false);
    Currently, if I see two rows in the future, one a day before the DST starts, and one after DST starts, both with the same intended 09am, the first shows 09am, and the second shows 08am. I'd love this 08am to be 09am.

    ----------------------------
    Edit, i tried changing my client time, by adding one hour, but the interface is not affected, so there is a conversion done at the server, of is there a conversion done at all?

    Also, the DateTimeItem behaves inconsistently. Just try to type in
    Code:
    2012/06/06 10:00
    And observe the value in the database
    Then retype it:
    Code:
    2012/06/06 10:00
    And the database value is different. This seems to happen for a future date that is using DST, while the current system time is in the same TZ, but without DST.

    Can someone help out here , or give some pointers? How would you implement my requirement?
    ----------------------------
    Edit 2:
    Ah! I googled around for this and found this in the following url:
    http://www.smartclient.com/smartgwt/release_notes.html
    Fix for bug whereby entering dates into a DateTime item when the date crossed the Daylight Savings Time boundary would lead to the hours getting changed on blur
    This is what happens to me in 3.0, but it was appearantly fixed in SGWT 2.4. It's come back?
    Last edited by Sytematic; 7 Feb 2012, 07:04.

    Comment


      #3
      Considering the lack of replies, one of the following things are happening:

      1. I'm being unclear
      2. You guys are still thinking about a solution :-P
      3. I am asking a stupid question.

      If 1 or 3 is the case, could you please say so, so that I can take the appropriate action.

      To summarize my previous ramblin', I think the following bug has returned:


      http://www.smartclient.com/smartgwt/release_notes.html
      Fix for bug whereby entering dates into a DateTime item when the date crossed the Daylight Savings Time boundary would lead to the hours getting changed on blur
      This is what happens to me in 3.0, but it was appearantly fixed in SGWT 2.4. The bug has returned? I tried using the latest 3.0p Power nightly (2012-02-27)

      Thanks in advance.
      Last edited by Sytematic; 27 Feb 2012, 05:45.

      Comment


        #4
        DST issues are tricky to speculate about because there are so many places where the problem could really be occurring, so this is one where we need to see a standalone test case tested against the latest patch build.

        Comment


          #5
          I found what went wrong:

          I had this in my code on a different spot, than the place i fiddled around with it:
          Code:
          DateUtil.setAdjustForDST(false);
          Removing all the calls to this function fixed the issue.

          Comment

          Working...
          X