Divine
Divine

Reputation: 11

bootstrap datetimepicker localization

Localization calendar is not coming from my snippet

$("#txtServiceFromDate").data("DateTimePicker").function({
        locale:'fr'
    }).on("dp.change", function (e) {
        $('#txtServiceToDate').data("DateTimePicker").setMinDate(e.date);
    });

 $("#txtServiceFromDate").datetimepicker({
        pickTime: false,

    }).on("dp.change", function (e) {
        $('#txtServiceToDate').data("DateTimePicker").setMinDate(e.date);
    });

Upvotes: 0

Views: 179

Answers (1)

madalinivascu
madalinivascu

Reputation: 32354

You are using the wrong localisation file from a different library, you need the localisation file for moment.js from what i can see from the documentation

You also need to initiate the language when you initiate the plugin

 $('#txtServiceFromDate').datetimepicker({
    locale:'fr'
});

or:

$('#datetimepicker1').data("DateTimePicker").locale('fr')

in version lower 4.0.0 you do

$('#txtServiceFromDate').datetimepicker({ language :'fr' });

Upvotes: 1

Related Questions