更改datetimepicker默认语言[datetimepicker]

时间:2018-03-10 15:53:37

标签: jquery date datetime datetimepicker

我在项目中使用DateTimePicker。我想改变语言。如何在此示例中使用https://github.com/jquery/jquery-ui/blob/master/ui/i18n/datepicker-tr.js插件运行它。提前谢谢..

 $('#appoimentDate').datetimepicker({
       format: "dd.mm.yyyy hh:ii",
       language: "tr"
  });

2 个答案:

答案 0 :(得分:0)

这应该有效。将它直接放在datetimepicker选项中。

$('#appoimentDate').datetimepicker({
    format: "dd.mm.yyyy hh:ii",
    closeText: "kapat",
    prevText: "<geri",
    nextText: "ileri&#x3e",
    currentText: "bugün",
    monthNames: [ "Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık" ],
    monthNamesShort: [ "Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara" ],
    dayNames: [ "Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi" ],
    dayNamesShort: [ "Pz","Pt","Sa","Ça","Pe","Cu","Ct" ],
    dayNamesMin: [ "Pz","Pt","Sa","Ça","Pe","Cu","Ct" ],
    weekHeader: "Hf",
    dateFormat: "dd.mm.yy",
    firstDay: 1,
    isRTL: false,
    showMonthAfterYear: false,
    yearSuffix: ""
});

答案 1 :(得分:0)

如果您在HTML中datepicker-tr.js之后加载jquery-ui.js,那么它应该已经使用tr语言。

例如

<script src="jquery.min.js"></script>
<script src="jquery-ui.min.js"></script>
<script src="datepicker-tr.js"></script>

查看我创建的Plunker Demo