var dformat = "[% dateformat %]";
var sentmsg = 0;
if (debug > 1) {alert("dateformat: " + dformat + "\ndebug is on (level " + debug + ")");}
-var MSG_PLEASE_ENTER_A_VALID_DATE = _("Please enter a valid date (should match %s).");
+var MSG_PLEASE_ENTER_A_VALID_DATE = (_("Please enter a valid date (should match %s)."));
function is_valid_date(date) {
// An empty string is considered as a valid date for convenient reasons.
var dateformat = dateformat_str = '[% Koha.Preference('dateformat') %]';
if ( dateformat == 'us' ) {
- if ( date.search(/\d{2}\/\d{2}\/\d{4}/) == -1 ) return 0;
+ if ( date.search(/^\d{2}\/\d{2}\/\d{4}($|\s)/) == -1 ) return 0;
dateformat = 'mm/dd/yy';
} else if ( dateformat == 'metric' ) {
- if ( date.search(/\d{2}\/\d{2}\/\d{4}/) == -1 ) return 0;
+ if ( date.search(/^\d{2}\/\d{2}\/\d{4}($|\s)/) == -1 ) return 0;
dateformat = 'dd/mm/yy';
} else if (dateformat == 'iso' ) {
- if ( date.search(/\d{2}-\d{2}-\d{4}/) == -1 ) return 0;
+ if ( date.search(/^\d{4}-\d{2}-\d{2}($|\s)/) == -1 ) return 0;
dateformat = 'yy-mm-dd';
} else if ( dateformat == 'dmydot' ) {
- if ( date.search(/\d{2}\.\d{2}\.\d{4}/) == -1 ) return 0;
+ if ( date.search(/^\d{2}\.\d{2}\.\d{4}($|\s)/) == -1 ) return 0;
dateformat = 'dd.mm.yy';
}
try {
buttonImageOnly: true,
showButtonPanel: true,
showOtherMonths: true,
- selectOtherMonths: true
+ selectOtherMonths: true,
+ yearRange: "c-100:c+10"
+ });
+
+$("#dateofbirth").datepicker({
+ yearRange: "c-100:c"
});
$( ".datepicker" ).datepicker({