Self-registration: system accepts wrong DOB format
Bug #1814150 reported by
Chauncey Montgomery
This bug report is a duplicate of:
Bug #2065448: omnibus patch for Patron Self-Registration improvements.
Edit
Remove
This bug affects 9 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Confirmed
|
Medium
|
Unassigned |
Bug Description
This issue is similar to Bug 1774253. We have found that when a patron enters the date incorrectly, viz., MM-DD-YYYY or MM/DD/YYYY, the date doesn't come through properly when staff load the pending patron.
In the case of MM-DD-YYYY, a random date is put in for the birth date (e.g., 01-01-1969 becomes 05-23-1906). If MM/DD/YYYY is entered, then the field is completely blank.
Either the format should accept MM-DD-YYYY and MM/DD/YYYY, or it should completely prevent the wrong format from being entered when the patron submits the form.
We are using 3.1.8.
tags: | added: patron self-registration |
Changed in evergreen: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
tags: |
added: selfregistration removed: self-registration |
To post a comment you must log in.
I thought there was already a launchpad bug for this, but I'm unable to find it.
I did a local fix for ours by tweaking the Javascript in the dobValidate function in js.tt2 to only accept dashes:
- var validformat = /^(19|20)\d\d([- /.])(0[ 1-9]|1[ 012])\2( 0[1-9]| [12][0- 9]|3[01] )$/ \d\d([- ])(0[1- 9]|1[012] )\2(0[1- 9]|[12] [0-9]|3[ 01])$/
+ var validformat = /^(19|20)
and
- alert("[% l('You have entered an invalid date, or an improperly formatted date. Please enter Date of Birth in YYYY-MM-DD or YYYY/MM/DD format and try again.') %]")
+ alert("[% l('You have entered an invalid date, or an improperly formatted date. Please enter Date of Birth in YYYY-MM-DD format and try again.') %]")
I'm not sure if that's the best approach to this or if it would be better to change the code to accept other formats.