Click here to Skip to main content
14,429,185 members
Rate this:
Please Sign up or sign in to vote.
See more:
I have a requirement where in a datetimepicker the maxdate should limit the time that can be chosen from the time part. Suppose the datetimepicker has dates enabled from 12th of oct to 15th of oct. I need that the all dates from 12th till 14th have 24 hrs of time in timepicker but only for the endate(her 15th of oct) the time should be enabled till 5pm for selection.

I am using jQuery DateTimePicker plugin v2.4.5.

Has anyone implemented this? Many thanks in advance.

What I have tried:

                    step: 30,
                    useCurrent: false,
                    defaultDate: new Date(('5/10/2019 2:00:00 AM')),
                    minDate: new Date('5/10/2019 2:00:00 AM'),
                    maxDate: new Date('5/16/2019 2:00:00 AM')
Updated 7-Nov-19 22:29pm

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

If you're talking about datetimepicker from, you need to set maxtime[^].
See: Set max and min datetime in jquery datetimepicker - Stack Overflow[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100