This is a migrated thread and some comments may be shown as answers.

Can I change the default appointment duration?

4 Answers 102 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Pete
Top achievements
Rank 1
Pete asked on 06 Sep 2017, 06:33 PM

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.

Thanks

4 Answers, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 07 Sep 2017, 01:29 PM
Hi Pete,

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:

views: [
{
type: "day",
majorTick: 120, 
minorTickCount: 1 
},
]


I hope that the Dojo example will help.


Regards,
Neli
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Pete
Top achievements
Rank 1
answered on 07 Sep 2017, 05:17 PM

Hi Neli,

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?

Pete

0
Accepted
Neli
Telerik team
answered on 08 Sep 2017, 10:45 AM
Hello Pete,

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.

Regards,
Neli
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Pete
Top achievements
Rank 1
answered on 08 Sep 2017, 09:22 PM

Thanks Neli,

The dojo example was a huge help. It now works exactly like I wanted it to.

Regards,

Pete

Tags
Scheduler
Asked by
Pete
Top achievements
Rank 1
Answers by
Neli
Telerik team
Pete
Top achievements
Rank 1
Share this question
or