handle start and end dates