Datepicker brings wrong calendar after filling in the field

0

It happens like this: Mum field date, when it is empty, it brings the datepicker correctly and fills the field in the format of yyyy-mm-dd bank and saved in that format. When I edit, when placing the cursor in this field, it brings a different calendar with another date. For example, if I choose 3/6/2017, it saves 2017-03-06 and when I edit it it shows a calendar of 1911. Where am I going wrong? Here is the code:

$(function() {
    $(".datepicker").datepicker({
        format: "dd/mm/yyyy",
        language: "pt-BR"
    });
});

...

<% = f.text_field: real_data_day, class: 'datepicker'% >

    
asked by anonymous 02.03.2017 / 19:41

1 answer

-1

Try entering the start date in this way.       startDate: "01/01/1930"

e .. f.text_field: birth_date, placeholder: 'dd / mm / yyyy',: class => "form-control datepicker"% >     

06.04.2017 / 23:39