Custom Editor Window recurrenceValidation error

Hi,

I have custom editor window(done based on https://ej2.syncfusion.com/angular/documentation/schedule/editor-template/). 
I replaced EndDate instad of DateTimePicker  with TimePicker(I don't need date only time). 
Everything works fine for simple events.

When i try to create recurring event , i receive recurrenceValidation  error:

core.js:6014 ERROR TypeError: endDate.getTime is not a function
    at EventWindow.recurrenceValidation (ej2-schedule.es2015.js:9009)
    at EventWindow.processEventValidation (ej2-schedule.es2015.js:8873)
    at EventWindow.eventSave (ej2-schedule.es2015.js:8834)
    at ZoneDelegate.invokeTask (zone-evergreen.js:391)
    at Object.onInvokeTask (core.js:39680)
    at ZoneDelegate.invokeTask (zone-evergreen.js:390)
    at Zone.runTask (zone-evergreen.js:168)
    at ZoneTask.invokeTask [as invoke] (zone-evergreen.js:465)
    at invokeTask (zone-evergreen.js:1603)
    at HTMLButtonElement.globalZoneAwareCallback (zone-evergreen.js:1629)

How can i setup EndDate as Time only correctly? 

EndDate setup in   onPopupOpen(args: any)
 let endElement: HTMLInputElement = args.element.querySelector('#EndTime') as HTMLInputElement;
      if (!endElement.classList.contains('e-datetimepicker')) {
        new TimePicker({
          value: new Date(endElement.value) || new Date()
        }, endElement);
      }



1 Reply 1 reply marked as answer

BS Balasubramanian Sattanathan Syncfusion Team September 21, 2020 11:38 AM UTC

Hi Yuriy, 

Greetings from Syncfusion Support. 

We have validated your reported scenario “How can i setup EndDate as Time only correctly?” at our side and let you know that we can resolve the reported problem by making use of the format property of the DateTimePicker component like the below code snippet. We have prepared a sample based on your requirement for your reference. And the recurrence events are also properly creating at our side. So we would suggest you to refer and follow the below sample. 

Code snippet:  
let endElement: HTMLInputElement = args.element.querySelector('#EndTime') as HTMLInputElement; 
if (!endElement.classList.contains('e-datetimepicker')) { 
    new DateTimePicker({ format: "h:mm a", value: new Date(endElement.value) || new Date() }, endElement); 
} 


Kindly try the above solution and let us know if you need further assistance. 

Regards, 
Balasubramanian S

Marked as answer
Loader.
Up arrow icon