Updating EndTime date when StartTime date changes

Hello, there this is currently what's happening.
Let's say I have an appointment as follows:



Now, let me change the start time date to May 23:



As you see here, the start time date is May 23rd but the end time date remains on May 22nd.
How can I change the end time date if there is a change in Start time date so that both dates can be the same? (e.g. Start time date June 22 -> July 23, automatically changes End time date June 22 -> July 23)

Thank you

1 Reply

NR Nevitha Ravi Syncfusion Team May 25, 2018 03:46 AM UTC

Hi Andrew, 

We can achieve your requirement ‘changing end date when start date is changed’ using change event of datepicker in schedule create event and for the same we have prepared a sample for your reference which can be downloaded from the following link. 

Please refer the below code example used in the sample. 
    function onCreate(args) {  //triggers on initial loading of schedule 
        if (ej.isNullOrUndefined(this._appointmentAddWindow)) this._renderAppointmentWindow(); 
        this._appointmentAddWindow.find("#" + this._id + "startdate").ejDatePicker({ 
            change: function (args) { 
                var schObj = $("#Schedule1").ejSchedule("instance"); 
                schObj._appointmentAddWindow.find("#" + schObj._id + "enddate").ejDatePicker("option", "value", args.value); // assigning start date value to end date. 
            } 
        }); 
    } 

 
Please check the above sample and let us know if you need further assistance on this. 

Regards, 
Nevitha. 


Loader.
Up arrow icon