Removing newlines from datepicker js function