-
-
Save AliceWonderland/6d108bff0673619120ec7e36887197f7 to your computer and use it in GitHub Desktop.
6.2 LongDate created by smillaraaq - https://repl.it/HGEi/1
This file contains hidden or 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
function longDate(myDate){ | |
var monthArray = ["", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]; | |
var dateArray = myDate.split("/"); | |
var month = monthArray[dateArray[0]]; | |
var day = dateArray[1]; | |
var year = dateArray[2]; | |
if(year.length === 2){ | |
if(year <= "20"){ | |
year = "20" + year; | |
} else { | |
year = "19" + year; | |
} | |
} | |
var finalDate = month + " " + day + ", " + year; | |
console.log(finalDate); | |
} | |
longDate("7/12/99"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment