Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change language for bootstrap DateTimePicker

I use bootstrap-datetimepicker.js Copyright 2012 by Stefan Petre

http://www.malot.fr/bootstrap-datetimepicker/index.php

I import the js and another language, for example Russian:

<script type="text/javascript"    src="/Resources/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script> <script type="text/javascript"    src="/Resources/plugins/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.ru.js" charset="UTF-8"></script> 

in document.ready

$(document).ready(function () {     // debugger;      $(".form_datetime").datetimepicker({         isRTL: false,         format: 'dd.mm.yyyy hh:ii',         autoclose:true     }); }); 

but it is not translated

I tried to insert on init

**language: "RU"** **language: "ru"** **language: "ru-RU"** 

but nothing changes, Do you have any proposal?

like image 260
Alex Avatar asked Oct 15 '13 13:10

Alex


People also ask

Does bootstrap have a Datepicker?

Bootstrap-datepicker provides a flexible datepicker widget in the Bootstrap style. Versions are incremented according to semver.


1 Answers

i think you have to set it in the options:

$(".form_datetime").datetimepicker({     isRTL: false,     format: 'dd.mm.yyyy hh:ii',     autoclose:true,     language: 'ru' }); 

if its not working, be sure that:

$.fn.datetimepicker.dates['en'] = {     days: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"],     daysShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],     daysMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"],     months: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],     monthsShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],     today: "Today" }; 

is defined for 'ru'

like image 62
mador Avatar answered Sep 21 '22 00:09

mador