-
Notifications
You must be signed in to change notification settings - Fork 129
Description
This is another all-day event off-by-one error, related to #92 and #150, but not fixed by bd918ec.
Let's say the begin time of a not-all-day event is in a timezone east of UTC (having a positive offset), for example 2019-05-29T12:34:56+02:00.
We now convert this Event to an all-day event using make_all_day, which will internally call floor('day') on that timestamp. As Arrow will still keep the timezone of the initial timestamp, the result is 2019-05-29T00:00:00+02:00, midnight on the beginning of 29th of May at Central European Summer Time.
When this event is now serialized to its String/ics representation, the function arrow_date_to_iso will be used to format this timestamp as date string. This function will convert the timestamp to UTC using .astimezone(tzutc), yielding 2019-05-28 22:00:00+00:00 - which is on the previous day.
The string that is finally written to the output is - you probably guessed it - DTSTART;VALUE=DATE:20190528.
This could probably be fixed by simply dropping the .astimezone(tzutc) call in the case of arrow_date_to_iso, as we are interested in the date per se not the exact time(-zone), but I'm not aware whether that would have any side-effects. Could you please fix this before making a new release (as per #153)?
Keep up the good work, this library is otherwise very pleasant to use (and I like the approach using extracts/outputs annotations).