1 2 Previous Next 19 Replies Latest reply on Feb 13, 2007 2:46 PM by gavin.king Go to original post
      • 15. Re: Problem with decrementing dates
        gavin.king

        OK, there is now support for #{timeZone} and #{timeZoneSelector.select}.

        * the timezone defaults to the server timezone, but this can of course be overridden either in components.xml or via the UI

        * I have created <s:convertDateTime/> which always uses the "Seam timezone", ie. #{timeZone}.

        * I have registered this as the *default converter* for java.util.Date, which eliminates a bunch of noisy date handling stuff in the view.

        Check the changes to the booking app to see how this is better.

        • 16. Re: Problem with decrementing dates
          gavin.king

          ie, this changeset:

          http://fisheye.jboss.com/changelog/JBoss/jboss-seam?cs=MAIN:gavin:20061011210119


          Note that the booking demo used to display times in UTC. Now it displays times in the server timezone.

          • 17. Re: Problem with decrementing dates
            costeen21

            Gavin,

            I don't think displaying the datetime in the Server's time zone to the end user is the best solution. I want the end user to see and enter datetimes in their own timezone and the server/database to handle everything in GMT. Actually, I really don't care what format the server handles it in as long as the end user views and enters dates in their own time zone.

            Wouldn't this be the functionality that most people would want? Otherwise the end user has to do timezone offset calculations in their head before entering their datetime.

            Am I missing something here?

            Thanks...

            • 18. Re: Problem with decrementing dates
              saeediqbal1

              costeen wouldn't that be just adding or subtracting hours from the GMT server time?

              • 19. Re: Problem with decrementing dates
                gavin.king

                 

                Am I missing something here?


                Yes, you missed the post immediately above where I explained the functionality for allowing the user to choose his timezone!

                OK, there is now support for #{timeZone} and #{timeZoneSelector.select}.

                * the timezone defaults to the server timezone, but this can of course be overridden either in components.xml or via the UI

                * I have created <s:convertDateTime/> which always uses the "Seam timezone", ie. #{timeZone}.

                * I have registered this as the *default converter* for java.util.Date, which eliminates a bunch of noisy date handling stuff in the view.


                AFAIK, there is no standard mechanism in HTTP for getting the users timezone, so we need to let them set it the first time, after which it can live in a cookie (if you so desire).

                Please refer to the Seam documentation, where this is discussed.


                1 2 Previous Next