min max dates handling