How can I configure the datepicker to only enable the user to choose Monday

Confluence User - 29 Nov, 2024

I am using Joget default date picker component, there are only option to disable weekend, but now I want to only enable for Monday. Do there any method to make this achieve?

datepicker

1


29 Nov, 2024
confluenceUser
confluenceUser

Hi there! We can achieve this using custom JQuery script. Follow the below steps:

  1. Drag and Drop "Custom HTML" field into your form
  2. Paste the below code and don't forget to replace the field_id with your actual date field id
    <script>
        $(document).ready(function() {
        $(".field_id").datepicker({ // replace "field_id" with your date field name"
            beforeShowDay: function(date) {
                // Check if the day is Monday (0 = Sunday, 1 = Monday, etc.)
                return [date.getDay() === 1, ''];
            }
        });
    });
    </script>																		
    
    
RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print