Get coerced into date error when trying to get a the vlaue from datetimeinput component

startDate = self.getSibling(‘StartDate’)
endDate = self.getSibling(‘EndDate’)
newdate =,5) is of type string while expects a date as the first argument. You will have to parse it into a date before trying to use it, assuming you are using the default format from the datetime input it would look like this:

newDate =,'MMM d, YYYY'),5)

If you’ve changed the format on, then just make sure the second argument in is the correct format for what is being returned from that property.

It would be more robust to use:

startDate ='StartDate').props.value)
endDate ='EndDate').props.value)

Now you can directly manipulate them with functions. You can also set props.value = to change the date, if desired.