Is there a way to set max and min time with the date and time picker

Is there a way to set max and min time with the date and time picker

INTONEINTONE Posts: 153Questions: 58Answers: 6

I know that one can set min and max date using: minDate and maxDate but is there a way to set the time for that also? I tried:

{
                    label:'Appointment date and time',
                    name:'applicationForm.interviewDateTime',
                    type:      'datetime',
                    def:       function () { return new Date(); },
                    format:    'DD/MM/YYYY h:mm A',
                    fieldInfo: 'Please click in the text box to reveal the date picker. All appointments should be 2 days in the future.',
                    opts: {
                        minutesIncrement: 20,
                        disableDays: [ 0, 6 ],
                        minDateTime: minDateTime, //today with a min time
                        maxDateTime:'maxDateTime //today with a max time
                    },
                    className:'required'
                },

it did not work, however. I still got the default time. Is there a way to do this?

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 15,112Questions: 1Answers: 2,583
    Answer ✓

    Hi @INTONE ,

    Yep, Editor 1.7.0 introduced the hoursAvailable option to datetime - this should do the trick for you.

    Cheers,

    Colin

  • INTONEINTONE Posts: 153Questions: 58Answers: 6

    Thank you.

This discussion has been closed.