added trim to parsing dates