Disable dates after the current date DataPicker

-1

I want to disable the dates after the current date in the dataPicker. I know how to disable the previous dates with the line:

startDate: "date"

However since this dataPicker would be for the Birth Date field, I do not think the dates after the current date are enabled, just the dates above. I understand that I could and will do the programming validation, but if I could disable it it would help a lot.

    
asked by anonymous 04.12.2017 / 12:32

1 answer

1

I managed to resolve. I used logic. If startDate: "date" disables the previous dates, then if I put:

endDate: "date",

It would disable subsequent dates and that's what happened:

Thecode:

<divclass="md-input-wrapper" id="sandbox-container">
    <input type="text" class="md-form-control">
    <label for="email">Data de Nascimento</label>
</div>
    <script>
        $('#sandbox-container input').datepicker({
            language: "pt-BR",
            format: "dd/mm/yyyy",
            endDate: "date",
            todayHighlight: true
        });
    </script>
    
04.12.2017 / 12:40