jquerytwitter-bootstrapbootstrap-datepickerdatapicker

Datapicker allow invalid dates


I need allow date like '99/99/9999' when user doesn't know exact date, how can I implement this?

$('#date').datepicker({
    language: "pt-BR",
    autoclose: true,
    format: 'dd/mm/yyyy',
    todayHighlight: true
})

Using this code, '99/99/9999' is converted to '07/06/9999'.

Here an example: https://jsfiddle.net/bvbtz2re/2/


Solution

  • Working fiddle.

    You could set the option constrainInput to false :

    $('#date').datepicker({
        language: "pt-BR",
        autoclose: true,
        format: 'dd/mm/yyyy',
        todayHighlight: true,
        constrainInput: false 
    })
    

    Hope this helps.