我使用以下选项以 LLLL 格式在 datetimepicker 中显示时间
$('#meeting_datetime').datetimepicker({defaultDate: tomorrowsDate, stepping: 5, format: 'LLLL'});
一切正常,但现在我想验证该字段,我认为它应该可以正常工作
$('#manage_jc_settings_form')
.formValidation({
framework: 'bootstrap',
excluded: ':disabled',
ignore: [],
icon: {
valid: 'glyphicon glyphicon-ok',
invalid: 'glyphicon glyphicon-remove',
validating: 'glyphicon glyphicon-refresh'
},
fields: {
meeting_datetime: {
validators: {
notEmpty: {
message: 'The date is required'
},
date: {
format: 'LLLL',
message: 'The date is not valid'
},
callback: {
message: "The next meeting can't be in the past",
callback: function (value, validator) {
var m = new moment(value, 'LLLL', true);
return (m > todaysDate);
}
}
}
}
}
}
});
但这样日期时间字段不会验证。有人知道如何在验证中使用 LLLL 格式吗?我正在使用 formValidation 插件http://formvalidation.io/ 感谢 carl