• Resolved Gabriel Soligo

    (@gabrielsoligo)


    Hello friends,

    First of all I congratulate the wonderful plugin.
    I have a problem with Date Picker, it is in the format for the English language, but I need to translate it to pt-BR, and make a small customization in your html ..

    The format is correct, what I need is to translate names of the months and days.

    Can this code help?

    
    / * Date Picker * /
    ???????? $ ('. sjb-datepicker'). datepicker ({
    ???????????? dateFormat: 'dd-mm-yy',
    ???????????? changeMonth: true,
    ???????????? changeYear: true,
    ???????????? yearRange: '-100: +50',
    ??????? });

    In what file should I change? What can be done?

    Sorry for the words, I’m using google translator.

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author PressTigers

    (@presstigers)

    Hello @gabrielsoligo,

    Yes, UI Datepicker supports localization. Please paste the below code above the datepicker callback in your simple-job-board-public.js file placed in the following directory: simple-job-board/public/js

    (function (factory) {
                if (typeof define === "function" && define.amd) {
    
                    // AMD. Register as an anonymous module.
                    define(["../widgets/datepicker"], factory);
                } else {
    
                    // Browser globals
                    factory(jQuery.datepicker);
                }
            }(function (datepicker) {
    
                datepicker.regional[ "pt-BR" ] = {
                    closeText: "Fechar",
                    prevText: "<Anterior",
                    nextText: "Próximo>",
                    currentText: "Hoje",
                    monthNames: ["Janeiro", "Fevereiro", "Mar?o", "Abril", "Maio", "Junho",
                        "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
                    monthNamesShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun",
                        "Jul", "Ago", "Set", "Out", "Nov", "Dez"],
                    dayNames: [
                        "Domingo",
                        "Segunda-feira",
                        "Ter?a-feira",
                        "Quarta-feira",
                        "Quinta-feira",
                        "Sexta-feira",
                        "Sábado"
                    ],
                    dayNamesShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"],
                    dayNamesMin: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"],
                    weekHeader: "Sm",
                    dateFormat: "dd/mm/yy",
                    firstDay: 0,
                    isRTL: false,
                    showMonthAfterYear: false,
                    yearSuffix: ""};
                datepicker.setDefaults(datepicker.regional[ "pt-BR" ]);
    
                return datepicker.regional[ "pt-BR" ];
    
            }));

    Thanks for reaching us out. Let us know if you need any further assistance.

    Regards,

    • This reply was modified 6 years, 11 months ago by PressTigers.
    • This reply was modified 6 years, 11 months ago by PressTigers.
    Thread Starter Gabriel Soligo

    (@gabrielsoligo)

    Thank you very much, the answer has solved my problem!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Date Picker Translation’ is closed to new replies.