I Want to put validation of end date should be max or equal from effective date if end date is there
effectiveDate: validator('presence', {
presence: true,
message: 'Please enter a valid value'
}),
endDate: validator('presence', {
value(model, attribute) {
// Validate a value that is not the current attribute
var effectiveDate = new Date(this.get('model').get('effectiveDate'));
var endDate = new Date(this.get('model').get('endDate'));
presence: effectiveDate > endDate;
},
message: 'Please enter a date value'
})
End date is not mendatory