From 0cf32949776b06cc82596527491f675f623f1565 Mon Sep 17 00:00:00 2001
From: Jitendra Purohit <jitendra@fuzion.co.nz>
Date: Wed, 8 May 2019 10:10:18 +0530
Subject: [PATCH 1/2] Add select2 to input field of datepicker

---
 CRM/Core/Form.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CRM/Core/Form.php b/CRM/Core/Form.php
index b396667fe7f4..8d0c6b20d647 100644
--- a/CRM/Core/Form.php
+++ b/CRM/Core/Form.php
@@ -1314,7 +1314,7 @@ public function addDatePickerRange($fieldName, $label, $isDateTime = FALSE, $req
       $label,
       $options,
       $required,
-      NULL
+      ['class' => 'crm-select2']
     );
     $attributes = ['format' => 'searchDate'];
     $extra = ['time' => $isDateTime];

From 0032e7af05fb1e50a5c0d581bd162bebd12d1234 Mon Sep 17 00:00:00 2001
From: Seamus Lee <seamuslee001@gmail.com>
Date: Fri, 10 May 2019 10:16:19 +1000
Subject: [PATCH 2/2] Add in Wrapper template around DatePickerRange template
 to have better layout of Activity Search Form

Allow for colspan and class to be set when adding in wrapper

Update the wrapper to be only one td and not all and fix activity template appropriately
---
 templates/CRM/Activity/Form/Search/Common.tpl |  5 ++--
 templates/CRM/Core/DatePickerRangeWrapper.tpl | 29 +++++++++++++++++++
 2 files changed, 31 insertions(+), 3 deletions(-)
 create mode 100644 templates/CRM/Core/DatePickerRangeWrapper.tpl

diff --git a/templates/CRM/Activity/Form/Search/Common.tpl b/templates/CRM/Activity/Form/Search/Common.tpl
index 315f6cd34e15..e9ac9139fa3e 100644
--- a/templates/CRM/Activity/Form/Search/Common.tpl
+++ b/templates/CRM/Activity/Form/Search/Common.tpl
@@ -89,9 +89,8 @@
 </tr>
 
 <tr>
-  <td>
-    {include file="CRM/Core/DatePickerRange.tpl" fieldName="activity_date_time"}
-  </td>
+  {include file="CRM/Core/DatePickerRangeWrapper.tpl" fieldName="activity_date_time" colspan="2"}
+  <td>&nbsp;</td>
 </tr>
 <tr>
   <td>
diff --git a/templates/CRM/Core/DatePickerRangeWrapper.tpl b/templates/CRM/Core/DatePickerRangeWrapper.tpl
new file mode 100644
index 000000000000..9396375a3889
--- /dev/null
+++ b/templates/CRM/Core/DatePickerRangeWrapper.tpl
@@ -0,0 +1,29 @@
+{*
+ +--------------------------------------------------------------------+
+ | CiviCRM version 5                                                  |
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC (c) 2004-2018                                |
+ +--------------------------------------------------------------------+
+ | This file is a part of CiviCRM.                                    |
+ |                                                                    |
+ | CiviCRM is free software; you can copy, modify, and distribute it  |
+ | under the terms of the GNU Affero General Public License           |
+ | Version 3, 19 November 2007 and the CiviCRM Licensing Exception.   |
+ |                                                                    |
+ | CiviCRM is distributed in the hope that it will be useful, but     |
+ | WITHOUT ANY WARRANTY; without even the implied warranty of         |
+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.               |
+ | See the GNU Affero General Public License for more details.        |
+ |                                                                    |
+ | You should have received a copy of the GNU Affero General Public   |
+ | License and the CiviCRM Licensing Exception along                  |
+ | with this program; if not, contact CiviCRM LLC                     |
+ | at info[AT]civicrm[DOT]org. If you have questions about the        |
+ | GNU Affero General Public License or the licensing of CiviCRM,     |
+ | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
+ +--------------------------------------------------------------------+
+*}
+{* Wrapper around DatePickerRange TPL file *}
+<td {if $colspan} colspan="{$colspan}" {else} colspan="2" {/if} {if $class} class="{$class}" {/if}>
+    {include file="CRM/Core/DatePickerRange.tpl" fieldName=$fieldName}
+</td>