mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Removed preceding 0 in date string
no issue - Removes preceding 0 in `date` section of a date string For ex. - 05 June -> 5 June
This commit is contained in:
parent
fa7258b247
commit
1baa21ddab
1 changed files with 1 additions and 1 deletions
|
@ -1,7 +1,7 @@
|
|||
export const getDateString = (isoDate) => {
|
||||
const date = new Date(isoDate);
|
||||
const month = date.toDateString().substring(4, 7);
|
||||
const day = date.toDateString().substring(8, 10);
|
||||
const day = date.toDateString().substring(8, 10).replace(/^0+/g, '');
|
||||
const year = date.toDateString().substring(11, 15);
|
||||
return `${day} ${month} ${year}`;
|
||||
};
|
Loading…
Add table
Reference in a new issue