Date picker shows assigned date inconsistently in the popup itself

I created a note from a calendar entry. The calendar entry shows correctly in the Calendar app on all my devices, but in Agenda, the date picker itself shows an inconsistent date (drawn to screen 3 times: once correctly, twice incorrectly). The date assigned to the note is also similarly incorrect, and will show as spanning multiple days for some notes depending on the start/end timestamps.
03%20AM

That’s very odd, what is the correct date according to the calendar app? Could you take a screenshot of the details of that event as shown in the Calendar app, especially of the start and end time details? Also, is this a recurring event? And is it in the timezone of your computer or is the event set to a occur in a different timezone?

One more question, what does the date say next to the title of the note itself? Is it listed as 28th or 27th?

My machine’s timezone is GMT-4, as that is where I live. The date next to the title of the note itself is the incorrect date (28th), though correct starting time of day (8:45pm). The .ics file exported from Calendar has the start/end times in UTC (DTSTART:20190928T004500Z), so should be formatted according to my machine’s local timezone… which seems correct, since it shows up correctly in Calendar. Subtracting 4 hours to account for my timezone, gives the correct local time… it sounds like your code is subtracting the 4 hours (giving the correct time) without without decrementing the date if this subtraction crosses midnight (giving an incorrect date). I’m guessing that another edge case that may show date errors is if the event is on the first of the month in UTC, but the local time zone is less than GMT (so may be last day of the previous month in local time zone)… you might not even get the correct month.

That’s very strange because there’s no distinction being made between date and time, but I have some ideas where to look. Any chance you could share with us the exported .ics file (could you email it to alex@agenda.com)? What is the city of your timezone as you’ve entered in the system preferences?

I’d rather not share .ics files for real events from my calendar.

Been some updates to the app, but the screenshot shows there’s still an issue…
image

Here’s one where the start time being 8pm local time (EST, or GMT-5) is after midnight UTC, and so even the starting date is incorrectly pushed to the next day (into the next month).
image

Ok, thanks for sharing these, very helpful, we’ll dive into it.