0

I'm using a date input with bootstrap-datepicker to show a calendar for the user to pick a date. I'm trying to change the calendar language to pt-BR and it is not working. I also can't change it to any other language.

I've tried this: How to change Bootstrap Datepicker Language and this: bootstrap-datepicker set language globally

I've tried to set the language to 'pt', 'pt-BR', 'br', 'BR', 'pt-PT' and none of it worked!

My code is like that:

<input type="text" name="date" class="form-control" id="date">

And the script:

    $('#date').datepicker({
        'language' : 'pt-BR',
    });

But the calendar is still at english language. How do I change that to portuguese?

1 Answers1

1
    <script type="text/javascript" 
      src="/Resources/plugins/bootstrap-datetimepicker/js/bootstrap-datetimepicker.js"></script>
    <script type="text/javascript" 
      src="/Resources/plugins/bootstrap-datetimepicker/js/locales/bootstrap-datepicker.pt-BR.min.js" charset="UTF-8"></script>


$("#date").datetimepicker({
    isRTL: false,
    format: 'dd.mm.yyyy hh:ii',
    autoclose:true,
    language: 'pt-BR'
});
Arpit Jain
  • 175
  • 5