Refactor calendar begin/end date constraints