From 4466c37a948395c3a1fd32b08a0dcda39f983287 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 4 Dec 2014 15:04:34 -0500 Subject: [PATCH] CRM-15689 - Fix js error in dateField initialization --- templates/CRM/common/jcalendar.tpl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates/CRM/common/jcalendar.tpl b/templates/CRM/common/jcalendar.tpl index fe0f08c476..6e933c49e0 100644 --- a/templates/CRM/common/jcalendar.tpl +++ b/templates/CRM/common/jcalendar.tpl @@ -74,6 +74,11 @@ {/literal} // Workaround for possible duplicate ids in the dom - select by name instead of id and exclude already initialized widgets var $dateElement = $('input[name={$displayDate}].dateplugin:not(.hasDatepicker)'); + {literal} + if (!$dateElement.length) { + return; + } + {/literal} {if $timeElement} var $timeElement = $dateElement.siblings("#{$timeElement}"); var time_format = $timeElement.attr('timeFormat'); -- 2.25.1