Error datepicker bootstrap calendar in bisex year

Asked

Viewed 776 times

1

I’m using the datepicker bootstrap, and found that the 2016 calendar is wrong. Today for example is day 01/07/2016 Friday and the calendar is displaying as if it were Saturday. inserir a descrição da imagem aqui

Can anyone tell me if there is any solution to solve this problem?

Javascript

$('#data_venda').datepicker({language: 'pt-br'});

translating

;(function($){
    $.fn.datepicker.dates['pt-BR'] = {
        days: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"],
        daysShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"],
        daysMin: ["Do", "Se", "Te", "Qu", "Qu", "Se", "Sa"],
        months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
        monthsShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"],
        today: "Hoje",
        monthsTitle: "Meses",
        clear: "Limpar",
        format: "dd/mm/yyyy"
    };
}(jQuery));
  • Can you post the website link of the component, the version you are using and how is the configuration? I use east of here and is normal.

  • I’m using this one right there. I’ll put the code in the question

  • Strange your start by the second. I think your problem is just the order of daysMin in the calendar shown, because the normal is to start by Sunday.

  • Only with $('#data_venda').datepicker(); gets that way?

  • We have found that there is something wrong with the translation that makes this occur. But we have not yet solved.

  • What version are you using? Could you create a fiddle for me to see?

  • In the files the version is not specified. But I just solved it here. It was the silliest thing

  • Post the answer to the guys anyway, go others also go through this silly thing?

Show 3 more comments

1 answer

2


After several tests it was identified that the problem was in the translation of the calendar causing it to start counting on Monday. What was done to solve:

On the translation line where it is specified:

$.fn.datepicker.dates['pt-BR']

I switched to $.fn.datepicker.dates['pt-br']

For some reason that I do not know when putting br in high box was translating but counting the wrong days. After placing br minuscule started to display the calendar correctly as in the image below:

inserir a descrição da imagem aqui

So the translation got that way:

;(function($){
    $.fn.datepicker.dates['pt-br'] = {
        days: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"],
        daysShort: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"],
        daysMin: ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"],
        months: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"],
        monthsShort: ["Jan", "Fev", "Mar", "Abr", "Mai", "Jun", "Jul", "Ago", "Set", "Out", "Nov", "Dez"],
        today: "Hoje",
        monthsTitle: "Meses",
        clear: "Limpar",
        format: "dd/mm/yyyy"
    };
}(jQuery));

Browser other questions tagged

You are not signed in. Login or sign up in order to post.