Datepicker: explain the unicode hex for the calendar icon
authorAndrew Hunt <andrew@aghstrategies.com>
Thu, 25 Oct 2018 13:14:16 +0000 (09:14 -0400)
committerAndrew Hunt <andrew@aghstrategies.com>
Thu, 25 Oct 2018 13:14:16 +0000 (09:14 -0400)
Also remove a comment that belonged to CSS that was previously removed

css/civicrm.css
js/crm.datepicker.js

index e4350899263747bd7ca2477d8411624bc8aae18d..d0c7e5c83120f71cc72831d012933bbb7d682c3c 100644 (file)
@@ -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;
 }
 
index 49965f5823efccfc6ce9481cb05d7849d755dd1f..0ae8f0b743ef901f98cb8d2c4c88e27cf71a7499 100644 (file)
@@ -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');