proposed usage of daterange picker

This commit is contained in:
robert schouten 2017-01-09 08:26:21 +08:00
parent 8b133ac087
commit 81130e848e
2 changed files with 9 additions and 11 deletions

View File

@ -4,16 +4,12 @@
frappe.query_reports["Daily Timesheet Summary"] = {
"filters": [
{
"fieldname":"from_date",
"label": __("From Date"),
"fieldtype": "Date",
"default": frappe.datetime.get_today()
},
{
"fieldname":"to_date",
"label": __("To Date"),
"fieldtype": "Date",
"default": frappe.datetime.get_today()
"fieldname":"date",
"label": __("Date"),
"fieldtype": "DateRange",
"start_with_value": true,
"default_from":frappe.datetime.get_today(),
"default_to":frappe.datetime.get_today(),
},
]
}

View File

@ -9,7 +9,9 @@ from frappe.desk.reportview import build_match_conditions
def execute(filters=None):
if not filters:
filters = {}
elif filters.get("from_date") or filters.get("to_date"):
elif filters.get("date") :
filters["from_date"] = filters["date"][0]
filters["to_date"] = filters["date"][1]
filters["from_time"] = "00:00:00"
filters["to_time"] = "24:00:00"