handle date correctly in near_edges