Merge pull request #8754 from prssanna/dashboard-fix

fix(Dashboards): Fix dashboard date range
This commit is contained in:
mergify[bot] 2019-11-04 07:52:34 +00:00 committed by GitHub
commit cf1fcba9e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View file

@ -175,19 +175,19 @@
"label": "Number of Groups"
},
{
"depends_on": "eval:doc.timespan === 'Choose Time Span'",
"depends_on": "eval:doc.timespan === 'Select Date Range'",
"fieldname": "from_date",
"fieldtype": "Date",
"label": "From Date"
},
{
"depends_on": "eval:doc.timespan === 'Choose Time Span'",
"depends_on": "eval:doc.timespan === 'Select Date Range'",
"fieldname": "to_date",
"fieldtype": "Date",
"label": "To Date"
}
],
"modified": "2019-10-29 02:26:14.838057",
"modified": "2019-11-04 12:32:14.525409",
"modified_by": "Administrator",
"module": "Desk",
"name": "Dashboard Chart",

View file

@ -19,8 +19,11 @@ def get(chart_name = None, chart = None, no_cache = None, from_date = None, to_d
chart = frappe._dict(frappe.parse_json(chart))
timespan = chart.timespan
from_date = chart.from_date
to_date = chart.to_date
if chart.timespan == 'Select Date Range':
from_date = chart.from_date
to_date = chart.to_date
timegrain = chart.time_interval
filters = frappe.parse_json(chart.filters_json)