top of page
Anchor 1

Wix Tutorial - Disable days on your datepicker

This tutorial will show you how to disable certain days of the week or any dates from your Wix Datepicker.

The days of the week are Monday = 1, Tuesday = 2, Wednesday = 3, Thursday = 4, Friday = 5, Saturday = 6, Sunday = 0.
Note that the months start with zero, i.e. January = 0, February = 1, etc.

Elements:

User Input:

  • datepicker: #datePicker1

Wix Code:

$w.onReady(function () {

    $w("#datePicker1").disabledDaysOfWeek = [6, 0];

    let badDate1 = new Date(2020, 5, 6);

    let badDate2 = new Date(2020, 6, 11);

    $w("#datePicker1").disabledDates = [badDate1, badDate2];

});

Demo:

Saturday and Sunday have been disabled (the show light grey) in the datepicker below, and June 6, 20120 and July 11, 2020 have been disabled.

Wix Code Disable Dates in Datepicker
bottom of page