jQuery UI Widgets Forums General Discussions Set date minimum value

This topic contains 1 reply, has 2 voices, and was last updated by  ivanpeevski 2 months, 2 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Set date minimum value #134422

    Steve2106
    Participant

    Hi There,

    I have a date field on a form.
    How do I set it so that a date prior to today cannot be chosen.
    This is what I am using for the date field:
    {
    bind: ‘dateBoxValue’,
    type: ‘date’,
    formatString: ‘dd/MM/yyyy’,
    todayString: ‘Today’,
    setMinDate:’Today’,
    label: ‘Date Pickup Required’,
    labelPosition: ‘left’,
    labelWidth: ‘40%’,
    align: ‘left’,
    width: ‘250px’,
    height: ’20px’,
    required: true
    },
    Best Regards,

    Steve.

    Set date minimum value #134425

    ivanpeevski
    Participant

    Hi Steve,

    You can set the “min” property of the date input after it has been created. Here is an example:
    https://jsfiddle.net/6na78kcz/1/

    let dateTimeInput = $("#sampleForm .jqx-datetimeinput");
    dateTimeInput.jqxDateTimeInput({ min: new Date(2023, 0, 1) });
    

    Best Regards,
    Ivan Peevski
    jQWidgets Team

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.