When getting events that are not marked all day, they have their properly timezoned start and end times, so turning them into a datetime object is no problem.
When an event is marked all day, their start and end times are just 'dates', so they get set to midnight automatically. However, when you attempt to turn these into datetimes, the timezone gets applied, so for me, being in GMT-6, if I pull an all day event for April 4th, its start time turns into: 04/04/2018T00:00:000Z
.
But then turning this into a date in JavaScript on my client side now turns into April 3rd at 7pm as it subtracts six hours for the timezone. If an event is not marked all day, then for me, it will correctly be six hours ahead, so when I turn it into a date in JavaScript, all is fine.
Is there a clean way to deal with these all day events and timezones?
04/04/2018T00:00:000Z
. Then in my javascript if I do new Date(thatTime), it applies the timezone and now it is 04/03/2018 7:00pm for GMT-5. Non all day events are fine because they were set with a proper datetime, but all day events just get set with a date, that converts to a datetime at midnight – Tyler Dahle Apr 2 '18 at 16:22