-
Notifications
You must be signed in to change notification settings - Fork 299
Closed
Description
I have 2 custom validators and for some strange reason, one gets the this.format() and this.formatLabel() methods and the other doesn't.
_.extend Backbone.Validation.validators,
isDate: (value, attr, dateFormat, model)->
return @format("{0} must be a valid date of the format {1}", @formatLabel(attr, model), dateFormat) if dateFormat && !(value instanceof Date)
isIpAddress: (value, attr, customValue, model)->
return @format("Not a valid {0}", @formatLabel(attr, model)) if !value.match(Backbone.Validation.patterns.isIpAddress)
isDate always gets them, isIpAddress never gets them. I've tried reordering them, renaming them, removing isDate, but no matter what I do isIpAddress never gets them. Any ideas?
Metadata
Metadata
Assignees
Labels
No labels