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: 152Questions: 57Answers: 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: 875Questions: 0Answers: 168
    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: 152Questions: 57Answers: 6

    Thank you.

Sign In or Register to comment.