Can I change the default appointment duration?

5 posts, 1 answers
  1. Pete
    Pete avatar
    5 posts
    Member since:
    Jul 2013

    Posted 06 Sep Link to this post

    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

  2. Neli
    Admin
    Neli avatar
    59 posts

    Posted 07 Sep Link to this post

    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.
  3. Pete
    Pete avatar
    5 posts
    Member since:
    Jul 2013

    Posted 07 Sep in reply to Neli Link to this post

    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

  4. Answer
    Neli
    Admin
    Neli avatar
    59 posts

    Posted 08 Sep Link to this post

    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.
  5. Pete
    Pete avatar
    5 posts
    Member since:
    Jul 2013

    Posted 08 Sep in reply to Neli Link to this post

    Thanks Neli,

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

    Regards,

    Pete

Back to Top