Changed the removeSegment function to use a moment formatted date object.