Recording MT5 Economic Calendar releases for Strategy Tester replay

How do you record MT5 Economic Calendar releases for a Strategy Tester replay that uses only the values available at the time? I’m looking at CalendarValueLast() . What’s a reliable way to timestamp the first observed actual and forecast values and flag gaps after a terminal disconnect?