using datepicker formatDate fn for formatting date