Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Converts ISO 8601 date string to human readable date string
function convertDateToReadableString (date) {
if (!date) return
const d = new Date(date.replace('-', '/'))
return d.toLocaleDateString('en-US', {
year: 'numeric',
month: 'long',
day: 'numeric'
assert(convertDate('2018-04-17'), 'April, 17 2018')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.