Search code examples
twitter-bootstrapdatetimepickersmalot-datetimepicker

Can't make Bootstrap Datetimepicker in Bulgarian language


I'm trying to make Datetimepicker in Bulgarian language. I tried with the following but it's still in English. How could I make it in Bulgarian?

<script src="https://github.com/smalot/bootstrap-datetimepicker/blob/master/js/locales/bootstrap-datetimepicker.bg.js"></script>

$(function () {
    $('#datetimepicker5').datetimepicker({ language: "bg-BG" });
});
<div class='input-group date'  id='datetimepicker5'>
    <input type='text' readonly="true" placeholder="Дата" class="form-control" name="createdDate" data-date-format="YYYY-MM-DD" value="<?php echo set_value('createdDate'); ?>" />
    <span class="input-group-addon" id="triangle_span" >
        <span class="glyphicon glyphicon-triangle-bottom"></span>
    <span class="glyphicon glyphicon-triangle-top"></span>
</span>

Solution

  • If you look at the i18n plugin it says

    $.fn.datetimepicker.dates['bg'] = {
    ...
    

    so

    $('#datetimepicker5').datetimepicker({ 
       language: "bg" 
    }); 
    

    would do the trick, demo -> http://jsfiddle.net/wm49Lv5x/

    Also I think you should refer to the "raw" version of the file, i.e

    <script src="https://raw.githubusercontent.com/smalot/bootstrap-datetimepicker/master/js/locales/bootstrap-datetimepicker.bg.js"></script>
    

    or

    <script src="https://rawgithub.com/smalot/bootstrap-datetimepicker/master/js/locales/bootstrap-datetimepicker.bg.js"></script>