From 771c4117233f94becd4a9a1fec774e3ac8886eda Mon Sep 17 00:00:00 2001 From: BroodjeAap Date: Tue, 20 Oct 2020 17:04:33 +0200 Subject: [PATCH] updated getMonthValueByString in DayCalculator to use Months class --- lib/util/DayCalculator.dart | 39 +------------------------------------ 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/lib/util/DayCalculator.dart b/lib/util/DayCalculator.dart index 5989c60..fae1c13 100644 --- a/lib/util/DayCalculator.dart +++ b/lib/util/DayCalculator.dart @@ -16,44 +16,7 @@ class DayCalculator { } static int getMonthValueByString(String month){ - switch(month){ - 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; - } - } + return Months.getFromString(month).value; } static int getCenturyValue(int year){