Hi All - whenever I set the isallday property to true when the calendar event is created It shows as started at 8:00 PM the previous day. Can someone share what property I am missing or need to add? Thanks in advance,
my laptop is east coast time frame - if that makes a difference.
thanks
The API now supports time zones. What you would want to do here is not specify your Start and End as UTC (indicated by the 'Z' prefix on the end), but instead specify it in your time zone. You would then set the StartTimeZone and EndTimeZone values to "Central European Time". So something like this:
This is just a example:
{
"Body": {
"Content": "Agenda",
"ContentType": "HTML"
},
"Start": "2015-01-30T00:00:00+01:00",
"End": "2015-02-01T00:00:00+01:00",
"ShowAs": "Busy",
"Location": {
"DisplayName": "Vesterbrogade"
},
"Subject": "Updated title",
"IsAllDay": true,
"StartTimeZone": "Central European Standard Time",
"EndTimeZone": "Central European Standard Time"
}
Source: https://stackoverflow.com/questions/28982218/all-day-events-are-not-created-correctly-in-office-365
------------------------------------------------------------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.
If you like my response, please give it a Thumbs Up.
@SpongYe Thanks for responding - I tried this but I still get the same error - if I don't have isallday set to true it works ok (with my original code) so that's why I referenced it ..... thx again
The problem isn't the isallday.
It looks like the startdate of the event:
DateAdd(DateTimeValue(DatePicker1.SelectedDate & " " &"12"&":"&"00"&"AM"), TimeZoneOffset(),TimeUnit.Minutes)
The TimeZoneOffset function returns the number of minutes between the user's local time and UTC (Coordinated Universal Time). Please read through the documentation here https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-dateadd-datediff
I assume you want the event to start at 12:00 AM. Then you need to change the code to:
DateTimeValue(DatePicker1.SelectedDate & " " &"12"&":"&"00"&"AM")
------------------------------------------------------------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.
If you like my response, please give it a Thumbs Up.
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional