Last active
September 4, 2016 16:59
-
-
Save hatemcode/51db32c7ad835c46a7e179e9d4a14ba1 to your computer and use it in GitHub Desktop.
Month Name Function in Javascript
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
/** | |
* @Month Name Javascript | |
* @author Hatem A. <hatem@tuta.io> | |
*/ | |
function monthName(num){ | |
num = parseInteger(num); | |
var month; | |
switch(str){ | |
case 1: | |
month = "January"; | |
break; | |
case 2: | |
month = "February"; | |
break; | |
case 3: | |
month = "March"; | |
break; | |
case 4: | |
month = "April"; | |
break; | |
case 5: | |
month = "May"; | |
break; | |
case 6: | |
month = "June"; | |
break; | |
case 7: | |
month = "July"; | |
break; | |
case 8: | |
month = "August"; | |
break; | |
case 9: | |
month = "September"; | |
break; | |
case 10: | |
month = "October"; | |
break; | |
case 11: | |
month = "November"; | |
break; | |
case 12: | |
month = "December"; | |
break; | |
default: | |
month = null; | |
} | |
return month; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment