From d883608e85bcad7dc0e693d67f5a521dae0390b6 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Sep 2014 17:14:30 +0100 Subject: [PATCH] Exclude dates js fix, do not add same date multiple times --- templates/CRM/Core/Form/RecurringEntity.tpl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/templates/CRM/Core/Form/RecurringEntity.tpl b/templates/CRM/Core/Form/RecurringEntity.tpl index 6253698d8c..e9ad71d2aa 100644 --- a/templates/CRM/Core/Form/RecurringEntity.tpl +++ b/templates/CRM/Core/Form/RecurringEntity.tpl @@ -401,7 +401,16 @@ //Exclude list function function addToExcludeList(val) { if(val !== ""){ - cj('#exclude_date_list').append(''); + var exists = false; + for(var i = 0, opts = document.getElementById('exclude_date_list').options; i < opts.length; ++i){ + if(opts[i].text == val){ + exists = true; + break; + } + } + if (exists == false){ + cj('#exclude_date_list').append(''); + } } } -- 2.25.1