From 32c5750e3b8251b7e277c595dc410a4e64b864a1 Mon Sep 17 00:00:00 2001 From: Andrew Hunt Date: Thu, 25 Oct 2018 09:14:16 -0400 Subject: [PATCH] Datepicker: explain the unicode hex for the calendar icon Also remove a comment that belonged to CSS that was previously removed --- css/civicrm.css | 1 - js/crm.datepicker.js | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/css/civicrm.css b/css/civicrm.css index e435089926..d0c7e5c831 100644 --- a/css/civicrm.css +++ b/css/civicrm.css @@ -2683,7 +2683,6 @@ div.crm-container form { /* Date plugin */ .crm-container input.dateplugin, .crm-container input.crm-form-date { - /* so that text doesn't flow on top of icon */ width: 9em; } diff --git a/js/crm.datepicker.js b/js/crm.datepicker.js index 49965f5823..0ae8f0b743 100644 --- a/js/crm.datepicker.js +++ b/js/crm.datepicker.js @@ -58,6 +58,8 @@ if (!settings.yearRange && settings.minDate !== null && settings.maxDate !== null) { settings.yearRange = '' + CRM.utils.formatDate(settings.minDate, 'yy') + ':' + CRM.utils.formatDate(settings.maxDate, 'yy'); } + // Set placeholder as calendar icon (`fa-calendar` is Unicode f073) + // and add datepicker $dateField.addClass('crm-form-date').attr({placeholder: '\uF073'}).datepicker(settings); } else { $dateField.attr('min', settings.minDate ? CRM.utils.formatDate(settings.minDate, 'yy') : '1000'); -- 2.25.1