Peculiar Behaviour of Models associated to Calendar component

Hi Guys,

as a temporary fix, you could try this:

Create two custom date/time formula fields. 

Start:

IF(IsAllDayEvent = true,DATETIMEVALUE(DATETIMEVALUE(DATE(YEAR(ActivityDate), MONTH(ActivityDate), DAY(ActivityDate))) +5/24),ActivityDateTime)

End:

IF(IsAllDayEvent = true,DATETIMEVALUE(DATETIMEVALUE(DATE(YEAR(ActivityDate), MONTH(ActivityDate), DAY(ActivityDate))) +19/24),ActivityDateTime+(DurationInMinutes/1440))

It looks a bit confusing, what you are doing here is:

First of all, you recreate the date based on the activity date. You have to do it this way, because SF gets confused with recordtypes elsehow. Afterwards, we cast the created date to a datetime field and add the start-/endtime as increments of a day (19/24 equals 7 o’clock in the evening in UTC +00:00). If it’s not an all day event, we simply take the start datetime of the event and add the duration. Since the duration is in minutes and we have to add it as well as increments of  a day, we have to divide the minutes by 1440.

Be aware, that you probably have to change the underlined part according to your time zone. In our time zone, this formulas create a duration from 7am to 9pm.

Hope that helps.