Ensure that the user should be able to specify an older date for the account expiration of the role/user. Fixes #6120

This commit is contained in:
Nikhil Mohite
2021-01-15 11:38:08 +05:30
committed by Akshay Joshi
parent f86f58dc56
commit a2edf317a9
3 changed files with 16 additions and 4 deletions

View File

@@ -2820,6 +2820,7 @@ define([
placeholder: 'YYYY-MM-DD HH:mm:ss Z',
extraClasses: [],
helpMessage: null,
setMinDate: true,
},
events: {
'blur input': 'onChange',
@@ -3008,6 +3009,18 @@ define([
data.value = null;
}
var dateSettings = {};
if (!data.setMinDate) {
dateSettings = {
'date': data.value,
};
} else {
dateSettings = {
'date': data.value,
'minDate': data.value,
};
}
this.$el.find('input').first().datetimepicker(
_.extend({
keyBinds: {
@@ -3044,10 +3057,7 @@ define([
}
},
},
}, this.defaults.options, this.field.get('options'), {
'date': data.value,
'minDate': data.value,
})
}, this.defaults.options, this.field.get('options'), dateSettings)
);
}
this.updateInvalid();