Change Start and End Time Default Events

How can I change the default Times that appear when I try to add a new event on the calendar with the mouse?

Also, how can I avoid the user input on the controls and fill the dropdown 'Times' with values set by me so user can only change times with dropdown 'times'.

as it is now it only shows 12:00AM


1 Reply

VR Vijay Ravi Syncfusion Team May 1, 2024 02:07 PM UTC

Hi Arturo,


We have validated your query for changing the start and end time. We suggest you use the popupOpen event to set args.duration = 60 to achieve your requirement. This will update the start and end time values in the timepicker, as demonstrated in the shared code snippet below. Please refer to the provided sample for your reference. Please try our shared sample.


UG for setting duration: https://ej2.syncfusion.com/angular/documentation/schedule/editor-template#customizing-the-default-time-duration-in-editor-window


[app.component.html]


<ejs-schedule #scheduleObj width='100%' cssClass='timeline-resource-grouping' height='650px'

       (popupOpen)='onPopupOpen($event)'  [timeScale]="timeScale" >

</ejs-schedule>


[app.component.ts]


 public onPopupOpen = (args) => {

    if (args.type === 'Editor') {

      args.duration = 60;

    }

  }


Sample: timescale schedule (forked) - StackBlitz


Output Screenshot:



Please get back to us if you need any further assistance.


Regards,

Vijay


Loader.
Up arrow icon