function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Timmy AhluwaliaTimmy Ahluwalia 

Event Date

Hi,
On Event object there are two fileds StartDateTime and EndDateTime,
on the aura component (not on the controller) how can i check that enddatetime of the event is greater than the startdatetime by 2 days.
then i want ot display Multiday event.
Thanks
Annu ChoudharyAnnu Choudhary
Hi Timmy,
You can use this   ####  if((Date.parse(events.EndDateTime) - Date.parse(events.startDateTime) )/ (1000*60*60*24)> = 2) 
Please select the best answer if it is working fine for you
Thanks
Timmy AhluwaliaTimmy Ahluwalia
Thanks Annu for the reply your command will work on the controllerbut i want to use it as an expression in the <aura: if > tag on the component.
Annu ChoudharyAnnu Choudhary
Hi Timmy,
You can implement this comparator logic in the apex controller itself and send the wrapper list of two properties - event & difference between its dates and then use on the markup of aura component. I hope It will work for you!