You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
window.Parsley.addValidator('date', {
validate: function(value, format) {
var date = moment(value, format, true);
return date.isValid();
},
messages: {
en: 'It must be a valid date with format %s',
it: 'Deve essere una data valida nel formato %s'
}
});
window.Parsley.addValidator('datebeforenow', {
validate: function(value, format) {
var date = moment(value, format, true);
// Trick to collaborate with date validator
if (! date.isValid()) {
return true;
}
return date.isBefore(moment());
},
messages: {
en: "Date must be before now",
it: "La data deve precedere la data attuale",
}
});
window.Parsley.addValidator('dateafternow', {
validate: function(value, format) {
var date = moment(value, format, true);
// Trick to collaborate with date validator
if (! date.isValid()) {
return true;
}
return date.isAfter(moment());
},
messages: {
en: "Date must be after now",
it: "La data deve esse posteriore alla data attuale",
}
});
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: