fixed date related bugs using datepicker and new formatting