fix issue related with time range bug.
When the user enters the activities that span over more than one date the period is messed up