Skip to content

Sync #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 1, 2020
Merged

Sync #50

Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
datetime convertion should use client timezone
  • Loading branch information
zhangchunlin committed Mar 31, 2020
commit c584833a474f77cc700e435735a48198ced3e0e1
4 changes: 2 additions & 2 deletions uliweb_apijson/apijson/views.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#coding=utf-8
from uliweb import expose, functions, models, UliwebError
from uliweb import expose, functions, models, UliwebError, request
from uliweb.orm import ModelNotFound
from uliweb.utils._compat import string_types
from uliweb.utils.date import to_datetime
Expand Down Expand Up @@ -300,7 +300,7 @@ def _conver():
nonlocal v
if v and col.type.python_type==datetime:
_v = v
v = to_datetime(v)
v = to_datetime(v,tzinfo=request.tzinfo)
if v==None:
raise UliwebError("'%s' cannot convert to datetime"%(_v))
if c1=='>':
Expand Down