I have this code:
var message = "The event starts at {1}";
var startTime = <FormattedTime value={new Date(eventData.startDateTime)}/>;
message = message.replace("{1}", startTime);
return (
<div>
{message}
<br/>
<FormattedTime value={new Date(eventData.startDateTime)}/><br/>
</div>
);
This prints as:
The event starts at [object Object]
5:55 PM
I have a feeling this has more to do with javascript than react, but... why does it print as [object Object] in one case and the correct time in another?
Is there a way to get my event string with the correct time?