[Datepicker] Disable all days except Saturday in datepicker 
Question
Datepicker
Web icon
Forge component by Hugo Pinheiro

How we can disable all days except Saturday in datepicker including apply min/max date range.

Solution

Hi Leandro,

I have discovered  solution of my question myself. I added few lines of code to accomplish the problem. 

1. Need to pass input parameter as below, to disable any days from datepicker calendar.

2. Need to add selected below line of code in JavaScript.

var DISALLOW_DAYS = [" + DaysToDisallow + "];

3. Add selected line of code in else condition as below.

beforeShowDay: function(date) {
                // date is a JS Date object
                return  [$.inArray(date.getDay(), DISALLOW_DAYS) == -1 ]
            },

Hope this will help to other.

mvp_badge
MVP

Hi Dear Arvind!

You have to customize the JS and create a logic to verify the weekday and if wasn't be saturday set the css class: "ui-datepicker-disabled", "ui-datepicker-unselectable" 

Solution

Hi Leandro,

I have discovered  solution of my question myself. I added few lines of code to accomplish the problem. 

1. Need to pass input parameter as below, to disable any days from datepicker calendar.

2. Need to add selected below line of code in JavaScript.

var DISALLOW_DAYS = [" + DaysToDisallow + "];

3. Add selected line of code in else condition as below.

beforeShowDay: function(date) {
                // date is a JS Date object
                return  [$.inArray(date.getDay(), DISALLOW_DAYS) == -1 ]
            },

Hope this will help to other.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.