我试图隐藏自助年历的时间,但它对我不起作用!我只想在日历中显示日期然后保存这个日期!我怎样才能在日历中停用时间! 我用过
displayEventTime:false
showtime:false
但他们不起作用!
这是我的代码!任何人都可以帮助我!提前谢谢
<!-- Bootstrap Material Datetime Picker Css -->
< link href = "../plugins/bootstrap-material-datetimepicker/css/bootstrap-material-datetimepicker.css"
rel = "stylesheet" / >
<!-- Bootstrap Material Datetime Picker Css -->
< link href = "../../plugins/bootstrap-material-datetimepicker/css/bootstrap-material-datetimepicker.css"
rel = "stylesheet" / >
<!-- Waves Effect Plugin Js -->
< script src = "../plugins/calendar/bootstrap-year-calendar.js" > < /script>
<!-- Waves Effect Plugin Js -->
< script src = "../plugins/calendar/bootstrap-year-calendar.min.js" > < /script>
<!-- Waves Effect Plugin Js -->
< script src = "../plugins/momentjs/moment.js" > < /script> < script src = "../plugins/momentjs/moment-range.js" > < /script> < script src = "../js/calendar.js" > < /script>
<!-- Bootstrap Material Datetime Picker Plugin Js -->
< script src = "../plugins/bootstrap-material-datetimepicker/js/bootstrap-
material-datetimepicker.js" > < /script>
function runclalendar(tasksList) {
var dataset = [];
var currentYear = new Date().getFullYear();
for (var i = 0; i < tasksList.length; i++) {
var taskdei = tasksList[i].req;
var eventss = {};
eventss.i = i,
eventss.name = taskdei.absenceReason,
eventss.location = taskdei.absenceReasonlabel,
eventss.startDate = moment(taskdei.startDate),
eventss.endDate = moment(taskdei.endDate)
dataset.push(eventss);
}
$('#calendar').calendar({
enableContextMenu: true,
enableRangeSelection: true,
minView: 2,
dateonly: true,
displayEventTime: false,
contextMenuItems: [{
text: 'Update',
click: editEvent
}, {
text: 'Delete',
click: deleteEvent
}],
selectRange: function(e) {
editEvent({
startDate: e.startDate,
endDate: e.endDate
});
},
mouseOnDay: function(e) {
if (e.events.length > 0) {
var content = '';
for (var i in e.events) {
content += '<div class="event-tooltip-content">' +
'<div class="event-name" style="color:' + e.events[i].color + '"> Congé de type ' + e.events[i].location + ' ( ' + e.events[i].name + ' ) </div>' +
'<div class="event-location">du ' + moment(e.events[i].startDate).format("YYYY/MM/DD") + ' au ' + moment(e.events[i].endDate).format("YYYY/MM/DD") + '</div>' +
'</div>';
}
$(e.element).popover({
trigger: 'manual',
container: 'body',
html: true,
content: content
});
$(e.element).popover('show');
}
},
mouseOutDay: function(e) {
if (e.events.length > 0) {
$(e.element).popover('hide');
}
},
dayContextMenu: function(e) {
$(e.element).popover('hide');
},
dataSource: dataset
});
console.log(dataset);
$('#save-event').click(function() {
saveEvent();
});
}