Created
April 19, 2019 05:22
-
-
Save abidvf/3e1d27377d07e055782616215586dfa5 to your computer and use it in GitHub Desktop.
Custom Date Format
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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