I am getting the error "$(...).datepicker() is not a function as I try to set a bootstrap datepicker on a form field in my MVC/razor form. I've read similar posts and can't seem to get their solutions to work. It seems like the order of dependencies matters. Any advice would be appreciated. I've referenced this as one solution I've tried without success. How to add Date Picker Bootstrap 3 on MVC 5 project using the Razor engine?
Script Block
<script src="~/Scripts/jquery-3.1.1.js"></script>
<script src="~/Scripts/jquery-3.1.1.min.js"></script>
<script src="~/Scripts/moment.js"></script>
<script src="~/Scripts/bootstrap-datepicker.js"></script>
<link href="~/Content/bootstrap-datepicker.css" rel="stylesheet" />
<link href="~/Content/bootstrap.min.css" rel="stylesheet"/>
<script type="text/javascript">
$(function () {
$('.datepicker').datepicker();
});
</script>
Form Field
<div class="form-group">
@Html.LabelFor(model => model.TrainingDate, htmlAttributes: new { @class = "control-label col-md-2" })
<div class="col-md-10">
@Html.EditorFor(model => model.TrainingDate, new { htmlAttributes = new { @class = "form-control datepicker" } })
@Html.ValidationMessageFor(model => model.TrainingDate, "", new { @class = "text-danger" })
</div>
</div>