refactor(datepicker): fully working version plus tests