Added a function to normalize the time grid start and end dates based on the current filter