Moved the api for the datepickers up into the shared directive