datepicker logic update