Make a directive for the date pickers rather than have all these functions in the controller. DRY (Don't Repeat Yourself) it up!