Fix #684 by implementing snap-to-edge for TimeItem-based classes