Problem 1:
Screenshot 1[
^]
Screenshot 2[
^]
Any ideas what might be causing it?
Problem 2:
I'm also having issues with datetimepicker not working at modal windows at all.
Screenshot Modal Console[
^]
Thanks in advance!
What I have tried:
Since it's MVC project, I've included CSS file in head of _Layout.
Added Moment.js and Datetimepicker.js to section Scripts.
I'm using Bootstrap 3.3.7 and Bootstrap Datetimepicker CSS 4.17.45
UPDATE:
Figured out that jQuery requirements for fullcalendar and datetimepicker were colliding.
FullCalendar works on 1.7.2, while DateTimePicker on 3.2.1
@{
Layout = null;
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Datetime and calendar test</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="~/Content/bootstrap.min.css" />
<link rel="stylesheet" href="~/Content/bootstrap-responsive.min.css" />
<link href="~/css/fullcalendar.css" rel="stylesheet" />
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class='col-sm-6'>
@Html.TextBox("Test", "", new { @class = "form-control", id = "datetimepicker4", type = "text" })
</div>
</div>
</div>
<div id="fullcalendar"></div>
<script src="~/Scripts/jquery-1.7.2.js"></script>
<script>var $Original = jQuery.noConflict(true);</script>
<script src="~/Scripts/jquery-3.2.1.js"></script>
<script>
var $New = jQuery.noConflict(true);
$ = $Original;
jQuery = $Original;
$.New = $New;
</script>
<script src="~/Scripts/bootstrap.js"></script>
<script src="~/Scripts/moment.min.js"></script>
<script src="~/js/fullcalendar.min.js"></script>
<script type="text/javascript">
$.New(document).ready(function () {
$.New('#datetimepicker4').datetimepicker();
});
</script>
<script>
$(document).ready(function () {
$('#fullcalendar').fullCalendar({
theme: false,
header: {
left: 'prev,next today',
center: 'title',
right: 'month,agendaWeek,agendaDay,listMonth'
},
navLinks: true,
editable: false,
eventLimit: false,
selectable: false,
eventClick: function (event, jsEvent, view) {
$('#modalTitle').html(event.title);
$('#modalBody').html(event.description);
$('#modalUrl').html(event.url2);
$('#modalUrl').attr('href', event.url2);
$('#modal-info-event').modal();
document.getElementById("eventId").value = event.Id;
console.log(document.getElementById("eventId"));
},
selectHelper: false,
select: function (start, end) {
var title = prompt('Event Title:');
var eventData;
if (title) {
eventData = {
title: title,
start: start,
end: end
};
$('#calendar').fullCalendar('renderEvent', eventData, true);
}
$('#calendar').fullCalendar('unselect');
},
events: {
url: "/Dashboard/GetEvents"
}
});
});
</script>
</body>
</html>
Googled a bit and found out jQuery versions can be sepparated. However I'm getting this error.
Error[
^]
Maybe I'm doing something wrong?