From e26d797d57964b2bd41941428f757200cc1a781b Mon Sep 17 00:00:00 2001 From: James Cole Date: Fri, 11 Dec 2015 18:32:57 +0100 Subject: [PATCH] Fix JS error. --- public/js/reports.js | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/public/js/reports.js b/public/js/reports.js index 3eba2fcff4..a9573ef06a 100644 --- a/public/js/reports.js +++ b/public/js/reports.js @@ -5,16 +5,19 @@ $(function () { "use strict"; drawChart(); - picker = $('#inputDateRange').daterangepicker( - { - locale: { - format: 'YYYY-MM-DD', - firstDay: 1, - }, - minDate: minDate, - drops: 'up', - } - ); + if ($('#inputDateRange').length > 0) { + + picker = $('#inputDateRange').daterangepicker( + { + locale: { + format: 'YYYY-MM-DD', + firstDay: 1, + }, + minDate: minDate, + drops: 'up', + } + ); + } // set values from cookies, if any: if (readCookie('report-type') !== null) {