Split the creation of the datepicker and mask into functions