i18n in external editor datepicker

i18n in external editor datepicker

imarderimarder Posts: 12Questions: 5Answers: 2

I am successfully externally using the standard editor datepicker on a page that holds an instance of datatables
i.e.
new $.fn.dataTable.Editor.DateTime( $('#datepicker'), {format: 'YYYY-MM-DD'});

but I am unable to force it into take the i18n: options such as
i18n:{
datetime:{
months:["Jaanuar","Veebruar","Märts","Aprill","Mai","Juuni","Juuli","August","September","Oktoober","November","Detsember"],weekdays:["P&uuml7hap","Esmasp","Teisip","Kolmap","Neljap","Reede","Laup"]}};

It just ignores and uses default English

However these i18n options work fine with inline, button and bubble editor within datatables.

I tried replace the
i18n: {... directive with
language: {...
Still no joy. Any insight would be welcome
thank you

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,743Questions: 1Answers: 10,111 Site admin
    Answer ✓

    You are hitting the fact that this isn't either documented or directly supported :). However, you can do what you are looking for - you just need to drop the datetime property in your object:

    new $.fn.dataTable.Editor.DateTime($('#DTE_Field_first_name'), {
        format: 'YYYY-MM-DD',
        i18n: {
            months: ["Jaanuar", "Veebruar", "Märts", "Aprill", "Mai", "Juuni", "Juuli", "August", "September", "Oktoober", "November", "Detsember"],
            weekdays: ["P&uuml7hap", "Esmasp", "Teisip", "Kolmap", "Neljap", "Reede", "Laup"]
        }
    });
    

    Allan

This discussion has been closed.