I was looking at code to detect the user timezone and store dates 
consistently in UTC format.
I made some changes in trunk to handle this. I could use some help testing.

1) In the header of your layout.html add:

 {{if not session.timezone:}}
  <script>
    
jQuery(function(){jQuery.post('{{=URL('default','set_timezone')}}',{timezone:(new
 
Date()).getTimezoneOffset()});});
  </script>
{{pass}}

2) in the default controller:

def set_timezone():
    session.timezone = int(request.vars.timezone)/60

3) Use the new timezone attribute of validators in trunk:

   Field('birthday','datetime',requires = 
IS_DATETIME(timezone=session.timezone)

Does it work for you? Suggestions for improvement?

Massimo

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to