From 16afbc211042bec038a15913ee7365690418328b Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Fri, 3 Jun 2011 15:17:48 -0400 Subject: [PATCH] Prevent future dates of birth in patron editor The patron editor form allowed staff to enter a date of birth that takes place in the future. While it is theoretically conceivable (hah) that a library might register patrons that have yet to be born, it is unlikely enough that we will not even assign this behavior to an org-unit setting, but we will take the bold move of using a regular expression to prevent a future dates of birth at all. Note that if a library system travels into the past, this will cause all sorts of problems in the patron editor interface (not to mention overdues). Please do not mix Evergreen and time travel. Signed-off-by: Lebbeous Fogle-Weekley Signed-off-by: Dan Scott --- Open-ILS/web/js/ui/default/actor/user/register.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Open-ILS/web/js/ui/default/actor/user/register.js b/Open-ILS/web/js/ui/default/actor/user/register.js index 9369e7e84f..1698cb1ec8 100644 --- a/Open-ILS/web/js/ui/default/actor/user/register.js +++ b/Open-ILS/web/js/ui/default/actor/user/register.js @@ -1005,6 +1005,9 @@ function attachWidgetEvents(fmcls, fmfield, widget) { return; case 'dob': + widget.widget.isValid = function() { + return this.attr("value") < new Date(); + }; dojo.connect(widget.widget, 'onChange', function(newDob) { if(!newDob) return; -- 2.43.2