简体   繁体   中英

bootstrap-datepicker set date before 1970

I use bootstrap-datepicker in a Django website. Users have to choice their birth date with the widget.

The issue is that user can't choose a date before the January 1st 1970. Do you know any way to select date before 1970 ?

In your DatePicker javascript, you should have a section like this:

$('.datePickerClass').datepicker({
    weekStart: 1,
    startDate: '01/01/1960',
    endDate: '01/01/2099', 
    autoclose: true
});

The startDate property will specify the earliest date which can be picked (ie in this case 01/01/1960), with the same going for endDate.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM