Skip to content

Instantly share code, notes, and snippets.

@abidvf
Created April 19, 2019 05:22
Show Gist options
  • Save abidvf/3e1d27377d07e055782616215586dfa5 to your computer and use it in GitHub Desktop.
Save abidvf/3e1d27377d07e055782616215586dfa5 to your computer and use it in GitHub Desktop.
Custom Date Format
export function customDateFormat(date) {
const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
const splittedDate = date.split("-")
const month = parseInt(splittedDate[1])-1
return months[month] +" "+ splittedDate[2] +", "+ splittedDate[0]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment