bootstrap-datepicker disable dates from another month

// link for issue
// https://github.com/Eonasdan/bootstrap-datetimepicker/issues/2077

//1 - Create these functions in a custom (DatePicker) namespace.
DatePicker = {
        hideOldDays: function(){ // hide days for previous month
            var x = $('.datepicker .datepicker-days tr td.old');
            if(x.length > 0){
                x.css('visibility', 'hidden');
                if(x.length === 7){
                    x.parent().hide();
                }
            }
        },
        hideNewDays: function(){ // hide days for next month
            var x = $('.datepicker .datepicker-days tr td.new');
            if(x.length > 0){
                x.hide();
            }
        },
        hideOtherMonthDays: function(){ // hide days not for current month
            DatePicker.hideOldDays();
            DatePicker.hideNewDays();
        }
    };
    
//2 - Add this event for datePicker
$('.datepicker').datepicker().on('show', function(e) {
        DatePicker.hideOtherMonthDays();
    });

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
disable back date in bootstrap datetimepicker datepicker disable past dates bootstrap bootstrap datepicker disable days of week bootstrap datepicker disable dates before today disable date range in bootstrap datepicker disabled dates in bootstrap datetimepicker class datepicker bootstrap disable future dates bootstrap datepicker disable dates function how to disable past date in bootstrap datepicker bootstrap datepicker disable dates before bootstrap datepicker time picker disable current date bootstrap datepickertime picker disable current date bootstrap datepicker disable current date disabled dates bootstrap-datepicker.min.js datetimepicker bootstrap disable dates bootstrap datepicker disable selection on dates bootstrap datepicker disable past months bootstrap datepicker disable weekends disable old date bootstrap datepicker bootstrapmaterialdatepicker disable date disable dates after specific date bootstrap datepicker bootstrap datetimepicker disable specific dates bootstrap datetimepicker disable past time bootstrap datetimepicker disable past dates disable dates in datepicker bootstrap before today disable date in datepicker bootstrap jquery bootstrap datepicker disable future days datepicker set disable dates on condition bootstrapui datepicker bootstrap datepicker disable future dates how to disable days in datepicker bootstrap how to disable days in bootstrap datetimepicker disable dates in bootstrap datepicker bootstrap datepicker disable dates demo disable specific date in bootstrap datepicker bootstrap datepicker disable dates dynamically disable dates datepicker bootstrap bootstrap datepicker disable past dates and disable weekends bootstrap datetimepicker disable sunday bootstrap datepicker set disable dates bootstrap-datetimepicker disable specific time bootstrap datepicker disable specific dates datepicker disable future dates of one year bootstrap datepicker disable past dates bootstrap datepicker disable dates datepicker bootstrap disable past dates disable dates from another month bootstrap datepicker bootstrap-datepicker disable dates from another month
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source