خرید بک لینک

Vote count: 0

I am using Bootstrap3 Datepicker and trying to count the number of active dates and retu them to the console. My current project is to count the days "worked" and retu them, therefore I need to use a multiple date selector (Range wont work). For example, I work MWF, I want to select 3 days in that week and retu a count of 3. In the future I would also like to know how to add the active days to an array.

The default events, http://bootstrap-datepicker.readthedocs.org/en/latest/events.html, don't seem to have anything related to the activation / deactivation of a date. The only event that seems to make sense is changeDate. This allows me to count, but also counts when I deactivate the date. I then tried to trigger a removal of count using clearDate, but that does seem to have any relationship with deactivating a date.

var count = 0 ;
$('#datepicker').datepicker({
    multidate: true
});
$('#datepicker').on('changeDate', function() {   
    count += 1;
 console.log(count);
});
$('#datepicker').on('clearDate', function() {   
    count -= 1;
    console.log(count);
});

asked 3 mins ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 10 فروردين 1395 ساعت: 22:23

صفحه بندی