Cats.Helpers.EthiopianDate.GetMonthNo C# (CSharp) Method

GetMonthNo() public static method

public static GetMonthNo ( string month ) : int
month string
return int
        public static int GetMonthNo(string month)
        {
            switch (month)
            {
                case "መስከረም":
                    return 1;
                case "ጥቅምት":
                    return 2;
                case "ህዳር":
                    return 3;
                case "ታህሳስ":
                    return 4;
                case "ጥር":
                    return 5;
                case "የካቲት":
                    return 6;
                case "መጋቢት":
                    return 7;
                case "ሚያዚያ":
                    return 8;
                case "ግንቦት":
                    return 9;
                case "ሰኔ":
                    return 10;
                case "ሐምሌ":
                    return 11;
                case "ነሃሴ":
                    return 12;
                case "ጳጉሜ":
                    return 13;
            }
            return -1;
        }

Usage Example

Example #1
0
        public DateTime ReturnGregorianDate(string am_date)
        {
            _date = am_date.Split('-');
            var ethDate = new EthiopianDate(int.Parse(_date[2]), EthiopianDate.GetMonthNo(_date[1]), int.Parse(_date[0]));

            ConvertedDate = ethDate.ToGregorianDate();
            return(ConvertedDate);
        }