Skip to content

Instantly share code, notes, and snippets.

@raflyfahrezi
Created December 18, 2020 02:48
Show Gist options
  • Save raflyfahrezi/77bd1ff1359bca56b4bb59e0429ac2a1 to your computer and use it in GitHub Desktop.
Save raflyfahrezi/77bd1ff1359bca56b4bb59e0429ac2a1 to your computer and use it in GitHub Desktop.
Javascript Date Full Month
const dateFormat = paramsDate => {
const month = new Array()
let temp = paramsDate
month[0] = 'January'
month[1] = 'February'
month[2] = 'March'
month[3] = 'April'
month[4] = 'May'
month[5] = 'June'
month[6] = 'July'
month[7] = 'August'
month[8] = 'September'
month[9] = 'October'
month[10] = 'November'
month[11] = 'December'
temp = temp.substr(0, 10)
temp = temp.split('-')
return `${Number(temp[2])} ${month[Number(temp[1]) - 1]} ${temp[0]}`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment