Skip to content
Snippets Groups Projects
Commit ee95ead5 authored by Ray Liu's avatar Ray Liu
Browse files

Added switch function to find Month

parent 073cdc4e
No related branches found
No related tags found
No related merge requests found
function findMonth(month){
switch(month){
case 1:
return "January";
case 2:
return "February";
case 3:
return "March";
case 4:
return "April";
case 5:
return "May";
case 6:
return "June";
case 7:
return "July";
case 8:
return "August";
case 9:
return "September";
case 10:
return "October";
case 11:
return "November";
case 12:
return "December";
}
}
function infoGenerator(names, dates, count){ function infoGenerator(names, dates, count){
...@@ -6,7 +40,7 @@ function infoGenerator(names, dates, count){ ...@@ -6,7 +40,7 @@ function infoGenerator(names, dates, count){
for (int i=0; i < names.length; i++){ for (int i=0; i < names.length; i++){
var year = dates[i][0]; var year = dates[i][0];
var month = dates[i][1]; var month = findMonth(dates[i][1]);
var day = dates[i][2]; var day = dates[i][2];
var name = names[i]; var name = names[i];
var count = count[i]; var count = count[i];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment