When I create a new appointment on the calendar, the default end time is 30 minutes after the selected start time. Is there a way to change the default end time to be 2 hours after the selected start time.
Essentially I want to change the default appointment duration from 1/2 hour to 2 hours.
4 Answers, 1 is accepted
The minorTickCount property is giving the opportunity to set different number of time slots per major tick. By default majorTick is set to 60 minutes and minorTickCount is set to 2, which means that there will be 2 slots for each hour.
Below is an example of configuration for changing the default duration of new appointments to be 2 hours:
I hope that the Dojo example will help.
That works but it drastically changes the functionality of the schedule and appointments. I don't want to only deal with 2 hour increments, I just want the default end to be 2 hours after the start. The user can change it to be a 1 hour appointment or a 3 hour appointment. I only want to affect to default duration, not the entire scheduler.
Is that possible in code?
The default event duration is depending on the duration of the slots. If it is two hours slot, then when creating a new event, by default it will span two hours, but still a shorter or longer time could be selected.
If you need to have a slot of for example 30 minutes, but when creating a new event the default duration to be two hours, we can suggest the following approach: on Edit event, if a new event is being created, the editor's end DateTimePicker's value to be set to 2 hours after after the start DateTimePicker's value. When the new value of the DateTimePicker is set the change event has to be triggered.
You could find the described implementation in the following Dojo.
The dojo example was a huge help. It now works exactly like I wanted it to.