LP1951642 Self-registration DOB autopopulating date user/gcollum/lp1951642-Self-registration-dob-autopopulating
authorGarry Collum <gcollum@gmail.com>
Mon, 27 Jun 2022 19:06:49 +0000 (19:06 +0000)
committerGarry Collum <gcollum@gmail.com>
Mon, 27 Jun 2022 19:06:49 +0000 (19:06 +0000)
This removes that autopopulation of the date and adds a placeholder field
showing the date format.

To test:

1. In library settings turn on "Allow Patron Self-Registration" and "Show dob
field in patron registration".  "Require dob field on patron registration"
can also be turned on to test that option.

2. Go to the "Request Library Card" page of the opac and notice that the
dob field is populated with today's date.

3. Apply the patch.

4. Go to the "Request Library Card" page.  The dob is no longer populated
with a date, and now displays a placeholder for the date format.

5. Create a few registrations with dob dates and no dob dates.

Signed-off-by: Garry Collum <gcollum@gmail.com>
Open-ILS/src/templates-bootstrap/opac/register.tt2

index 73cc273..267e150 100755 (executable)
@@ -157,7 +157,7 @@ FOR field_def IN register_fields;
         <div class="col-md-6">
             [% IF fname == "dob"; %]
             <div class="input-group date" data-provide="datepicker-inline">
-                <input type="text" class="form-control datepicker" id='[% field_path %]'
+                <input type="text" placeholder="yyyy-mm-dd" class="form-control datepicker" id='[% field_path %]'
                     name='[% field_path %]' value='[% value || CGI.param(field_path) | html %]' [% IF require %]required[% END %] data-date-format="yyyy-mm-dd" />
                 <div class="input-group-addon">
                     <span class="glyphicon glyphicon-th"></span>
@@ -262,6 +262,6 @@ $(document).ready(function(){
         autoclose: true,
         todayHighlight: true,
     });
-    $('.datepicker').datepicker("setDate", new Date());
+    $('.datepicker').datepicker("setDate", "");
 });
 </script>