Browse Source

Fix Date between query

version-14
Faris Ansari 8 years ago
committed by Nabin Hait
parent
commit
95edd73b5b
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      frappe/model/db_query.py

+ 2
- 2
frappe/model/db_query.py View File

@@ -300,8 +300,8 @@ class DatabaseQuery(object):
if f.operator.lower() == 'between' and \
(f.fieldname in ('creation', 'modified') or (df and (df.fieldtype=="Date" or df.fieldtype=="Datetime"))):
value = "'%s' AND '%s'" % (
get_datetime(f.value[0]).strftime("%Y-%m-%d %H:%M:%S.%f"),
add_to_date(get_datetime(f.value[1]),days=1).strftime("%Y-%m-%d %H:%M:%S.%f"))
add_to_date(get_datetime(f.value[0]),days=-1).strftime("%Y-%m-%d %H:%M:%S.%f"),
get_datetime(f.value[1]).strftime("%Y-%m-%d %H:%M:%S.%f"))
fallback = "'0000-00-00 00:00:00'"

elif df and df.fieldtype=="Date":


Loading…
Cancel
Save