I am creating a day range validator using DataAnnotations, jQuery.validate and jquery.validate.unobtrusive. I\'ve already read the following: http://bradwilson.typepad.com/
Reference: http://bradwilson.typepad.com/blog/2010/10/mvc3-unobtrusive-validation.html
adapters.addMinMax()'s param is orderby this:
adapterName, minRuleName, maxRuleName, minMaxRuleName, minAttribute, maxAttribute
so you need this:
jQuery.validator.unobtrusive.adapters.addMinMax('dayrange', '', '', 'dayrange','minlength', 'maxlength');
AND,,,
param.min, param.max be sure to undefine. param is an purely array as: ['111','000'].
so you need:
var minDate = now.setDate(now.getDate() - param[0]);
var maxDate = now.setDate(now.getDate() + param[1]);