Move date formatting into a function
Move date formatting into a function

We no longer need to replace dashes with slashes in the date string as
we don't support IE8 any longer and IE9 upwards can parse the dates as
they are.

annapowellsmith/openpresc,ebmdatalab/openprescribing,annapowellsmith/openpresc,ebmdatalab/openprescribing,ebmdatalab/openprescribing,annapowellsmith/openpresc,ebmdatalab/openprescribing,annapowellsmith/openpresc