updated getMonthValueByString in DayCalculator to use Months class
This commit is contained in:
parent
0de095167e
commit
771c411723
1 changed files with 1 additions and 38 deletions
|
@ -16,44 +16,7 @@ class DayCalculator {
|
||||||
}
|
}
|
||||||
|
|
||||||
static int getMonthValueByString(String month){
|
static int getMonthValueByString(String month){
|
||||||
switch(month){
|
return Months.getFromString(month).value;
|
||||||
case "January":{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
case "February":{
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
case "March":{
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
case "April":{
|
|
||||||
return 6;
|
|
||||||
}
|
|
||||||
case "May":{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
case "June":{
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
case "July":{
|
|
||||||
return 6;
|
|
||||||
}
|
|
||||||
case "August":{
|
|
||||||
return 2;
|
|
||||||
}
|
|
||||||
case "September":{
|
|
||||||
return 5;
|
|
||||||
}
|
|
||||||
case "October":{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
case "November":{
|
|
||||||
return 3;
|
|
||||||
}
|
|
||||||
default:{
|
|
||||||
return 5;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int getCenturyValue(int year){
|
static int getCenturyValue(int year){
|
||||||
|
|
Loading…
Add table
Reference in a new issue