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.

Websites designed by WixCreate that use the above Wix Code:

None

Official Wix Expert & Wix Agency Partner

© 2020 by WIXCreate.com

I  All Rights Reserved  I  info@wixcreate.com  I  202-640-5440

facebook-2.gif