Simplified code, set min and max dates for datepickers