• Resolved imfaisalwp

    (@imfaisalwp)


    MetForm using flatpickr for Date Calendar, I want to know how do I disable Sat & sun day.

    exp: my service is close in every sat & sun Day. There is no option to disable a day of the week.

    If there are no prebuild options for this, then pls help with js or any code.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @imfaisalwp ,

    I understand your need and this feature seems very useful. But our date field widget is based on date only and you can disable specific dates not specific week days.

    So, navigate to our plugin’s details page on useful links section. Here you will find the feature request link. I recommend you to make a feature request there and we will try to add this feature in our future update.

    Regards,
    Benjir

    Thread Starter imfaisalwp

    (@imfaisalwp)

    Thank you for your reply. This is a great plugin.

    This feature is not inbuild, and MetForm also using flatpickr.js for Date selection.
    And flatpickr already have this feature.
    https://flatpickr.js.org/examples/#disabling-dates

    I try to use this but when I click on the date selector it’s showing me 2 calendars. One is normal and when I select any date from another calendar my form is disappear.

    Please help me with modifying this code.

    
    <script>
    var $ = jQuery
    $(document).ready(function(){
    
    $(".selector").flatpickr({
    	
        "disable": [
            function(date) {
                // return true to disable
                return (date.getDay() === 0 || date.getDay() === 6);
    
            }
        ],
        "locale": {
            "firstDayOfWeek": 1 // start week on Monday
        }
    });
    
    })    
    </script>
    

    Hi @imfaisalwp ,

    Our plugin is built with React JS and if you want to override the functionality of the plugin then you have to do it in that way. Using jQuery will not work properly in this case. Also for this customization request we can’t help you more.

    Regards,
    Benjir

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Date Calendar Disable Day of week.’ is closed to new replies.