diff --git a/ghost/portal/src/utils/date-time.js b/ghost/portal/src/utils/date-time.js index e7179a36ac..9e04e4c034 100644 --- a/ghost/portal/src/utils/date-time.js +++ b/ghost/portal/src/utils/date-time.js @@ -1,7 +1,5 @@ export const getDateString = (isoDate) => { - const date = new Date(isoDate); - const month = date.toDateString().substring(4, 7); - const day = date.toDateString().substring(8, 10).replace(/^0+/g, ''); - const year = date.toDateString().substring(11, 15); - return `${day} ${month} ${year}`; -}; \ No newline at end of file + const event = new Date(isoDate); + const options = { year: 'numeric', month: 'short', day: 'numeric' }; + return event.toLocaleDateString('en-GB', options); +};