remove spaces from dates and add return statement

...r_contrib function