summaryrefslogtreecommitdiff
path: root/addons/web_graph
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2014-01-22 16:19:11 +0100
committerXavier Morel <xmo@openerp.com>2014-01-22 16:19:11 +0100
commit5b7ade9db180b8a038c2a9944aba85d1ffd220ea (patch)
tree14a6c6b3052a756f2032baef042060dfc6ac99ab /addons/web_graph
parent36eedfab43a28b72a6dd6375c0f71828f238fc37 (diff)
[ADD] ways to correctly handle local datetimes in e.g. domains
* change datetime.now() to generate user-local naive datetimes * add datetime.utcnow() behaving as the old now() * add date.today() generating a user-local date (for the current day) * add datetime.replace() to replace any specific attribute of the datetime object (except tzinfo, for now) * datetime.toJSON() now returns the equivalent javascript Date object (warning: uses the datetime attributes directly, since datetimes are naive if they were created with utcnow() the Date result is going to be complete nonsense). With the previous commit datetime.now() generates a user-local now() which is converted to the correct UTC datetime when sent to the server. This means it becomes possible to generate datetime bounds for the user's local today with either datetime.datetime.now().replace(hour=0, minute=0, second=0) or datetime.datetime.combine( datetime.date.today(), datetime.time()) and once send over JSON-RPC the server will get the local datetime in UTC to the server's format. nb: user-local means "in the timezone of the user's browser" in this context. bzr revid: xmo@openerp.com-20140122151911-akn1nr6e739eg92s
Diffstat (limited to 'addons/web_graph')
0 files changed, 0 insertions, 0 deletions