Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap datetimepicker not showing control icons

Developing MVC application and in Razor i imported those scripts:

<link rel="stylesheet" href="@Url.Content("~/Content/bootstrap.min.css")">
<link rel="stylesheet" href="@Url.Content("~/Content/bootstrap-datetimepicker.min.css")">
<link rel="stylesheet" href="@Url.Content("~/Content/_bootstrap-datetimepicker.less")">
<script src="@Url.Content("~/Scripts/jquery-3.3.1.min.js")"></script>
<script src="@Url.Content("~/Scripts/bootstrap.min.js")"></script>
<script src="@Url.Content("~/Scripts/popper.min.js")"></script>
<script src="@Url.Content("~/Scripts/moment-with-locales.min.js")"></script>
<script src="@Url.Content("~/Scripts/bootstrap-datetimepicker.min.js")"></script>

i set datetimepicker like this:

$('#datetimepicker').datetimepicker({
    locale: 'cs',
    format: 'DD.MM.YYYY',
    dayViewHeaderFormat: 'MMMM YYYY',
    minDate: today,
    stepping: 1,
    showTodayButton: true,
    allowInputToggle: true
});
$('.timepicker').datetimepicker({
    locale: 'cs',
    format: 'HH:mm',
    dayViewHeaderFormat: 'MMMM YYYY',
    stepping: 5,
    allowInputToggle: true
});

and my datetimepicker nor timepicker are showing arrowbuttons for control as you can see on picture:

enter image description here

Both has those controlling elements on its place but without icons and i can not find out why.

like image 787
j.j.a.c.k. Avatar asked Dec 03 '22 20:12

j.j.a.c.k.


1 Answers

Bootstrap doesn't support glyphicons. You need to give a separate icon library to it.

<link href="~/Content/font-awesome.min.css" rel="stylesheet" />
<link href="~/Content/bootstrap-datetimepicker.min.css" rel="stylesheet" />

$('.datepicker').datetimepicker({
    format: 'DD/MM/YYYY HH:mm', 
    useCurrent: false,
    showTodayButton: true,
    showClear: true,
    toolbarPlacement: 'bottom',
    sideBySide: true,
    icons: {
        time: "fa fa-clock-o",
        date: "fa fa-calendar",
        up: "fa fa-arrow-up",
        down: "fa fa-arrow-down",
        previous: "fa fa-chevron-left",
        next: "fa fa-chevron-right",
        today: "fa fa-clock-o",
        clear: "fa fa-trash-o"
    }
});
like image 58
sushil suthar Avatar answered Dec 08 '22 06:12

sushil suthar