Can I somehow exclude several dates and dates ranges in the datepicker field?

Support General Can I somehow exclude several dates and dates ranges in the datepicker field?Resolved

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #32011
    paul@webdegelijk.nl[email protected]
    Participant

    Would that be possible?

    Regards,
    Paul

    #32022
    Long NguyenLong Nguyen
    Moderator

    Hi,

    For a range, you can use the JS options minDate and maxDate. Example

    [
        'name'       => __( 'Date', 'your-text-domain' ),
        'id'         => $prefix . 'date_xabk9calx28',
        'type'       => 'date',
        'js_options' => [
            'minDate' => -5,
            'maxDate' => '+5D',
        ],
    ],

    For some specific dates, Meta Box does not support doing that. You can follow this article to do by using the code https://codehasbug.com/javascript/disable-specific-date-in-jquery-datepicker/

    #32042
    paul@webdegelijk.nl[email protected]
    Participant

    Thanks for the info!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.