From d88022d3b56927454a1c6f4a4323502efe98c641 Mon Sep 17 00:00:00 2001 From: Keerthi Niranjan Date: Thu, 23 Nov 2017 18:10:46 +0530 Subject: [PATCH] SEARCH-480 - Code refactoring --- js/search/search.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/js/search/search.js b/js/search/search.js index a63c0e05..4df03f4e 100644 --- a/js/search/search.js +++ b/js/search/search.js @@ -258,9 +258,7 @@ class Search { let sd_time = searchPeriod; if (startDate) { sd_time = new Date(parseInt(startDate, 10)).getTime(); - if (!sd_time) { - sd_time = searchPeriod; - } else if (sd_time < searchPeriod) { + if (!sd_time || sd_time < searchPeriod) { sd_time = searchPeriod; } }