1
Hello, I’m developing a panel and I need the datepicker in Portuguese, I tried to modify the js file itself but the dates disappeared.
$('#datepicker').datepicker({
autoclose: true,
language:'pt-BR',
format: {
/*
* Say our UI should display a week ahead,
* but textbox should store the actual date.
* This is useful if we need UI to select local dates,
* but store in UTC
*/
toDisplay: function (date, format, language) {
var language ='pt-BR';
var data = new Date(date);
var dia = date.getDate()+1;
console.log(dia);
if (dia.toString().length == 1)
dia = "0"+dia;
var mes = data.getMonth()+1;
if (mes.toString().length == 1)
mes = "0"+mes;
var ano = data.getFullYear();
//console.log(moment().format('mm'));
console.log(language);
return dia+"/"+mes+"/"+ano;
},
toValue: function (date, format, language) {
var d = new Date(date);
d.setDate(d.getDate() + 7);
// console.log(new Date(d));
return new Date(d);
}
}
});
});
So that this
format
? Try it like this:$('#datepicker').datepicker({
 format: "dd/mm/yyyy",
 startView: 2,
 language: "pt-BR" 
 });
– Jorge.M
He took the amount from the day before.
– Fernando Santana
Ficou em português?
– Jorge.M
I now had the choice of year and month but did not translate. @Jorgematheus
– Fernando Santana
I found the bug @Jorgematheus, the minified version was set to 'en' so prioritized this config Linkei ai managed to define in the script call.
– Fernando Santana
show, glad you solved!
– Jorge.M