Re: Create Calendar event over multiple days between set times?
Hi @19Flash92
I see what you mean. So this will require some additional logic.
Based on 7th 12:00 to 10th 17:00
if(less(body('Subtract_from_time'),parsedatetime(outputs('ComposeStart'))),1,0)
If the subtract from time (7th 17:00) is less than the start time (7th 12:00), we add 1 day to the first end date, else 0. Therefore the end date 7th 17:00 + 0 in this case. I have added a compose to make this calculation and updated the composefirstenddate to adddays(body('Subtract_from_time'),outputs('ComposeTimeCheck')).
if(less(body('Subtract_from_time'), parsedatetime(outputs('ComposeStart'))),0,1)
If the subtract from time (7th 17:00) is less than the start time (7th 12:00), we add 0 days to the range or date difference, otherwise in this case, we add on 1. I have added a compose for this calculation of logic too and I have updated the range to
range(0,add(outputs('ComposeDifferenceDays'),outputs('ComposeTimeCheckRange')))
Based on testing....
returns:
and...
returns:
I tested on matching times too and you would get three events based on both times being the same.
Please let me know if that works for you. I was trying to think of more simple logic, but not sure how.
Damien