Feb 15, 2018

Bootstrap Custom Controls

Feb. 2018

Bootstrap Date picker with localization

Only one package required for example Bower or npm:

bootstrap-datepicker 

Reference package and css with appropriate Locale file. Dist folder is here only due to Bower :

    <link rel="stylesheet" href="~/lib/bootstrap-datepicker/dist/css/bootstrap-datepicker.standalone.min.css" />
...

<script src="~/lib/bootstrap-datepicker/dist/js/bootstrap-datepicker.min.js"></script>
 <script src="~/lib/bootstrap-datepicker/dist/locales/bootstrap-datepicker.hr.min.js"></script>

Set language param during init and it should work:

            $('input[name="Birthday2"]').datepicker({
                isRTL: false,
                format: 'dd.mm.yyyy',
                autoclose: true,
                language: 'hr'
            });


Bootstrap Multiselect Checkpoint

https://github.com/davidstutz/bootstrap-multiselect.git

http://davidstutz.de/bootstrap-multiselect/

Apply on existing <select> DOM element.

<script src="~/lib/bootstrap-multiselect/dist/js/bootstrap-multiselect.js"></script>
<link rel="stylesheet" href="~/lib/bootstrap-multiselect/dist/css/bootstrap-multiselect.css"/>


$(dom.multiselectCss).multiselect();

No comments:

Post a Comment