finding min/max dates at runtime