Ejemplo n.º 1
0
        public static string[] GetMonthNames(MonthNameType monthNameType, CultureInfo culture)
        {
            switch (monthNameType)
            {
            case MonthNameType.Numbers:
                return(new string[] {
                    "01", "02", "03", "04",
                    "05", "06", "07", "08",
                    "09", "10", "11", "12",
                    ""
                });

            case MonthNameType.ShortNames:
                return(culture.DateTimeFormat.AbbreviatedMonthNames);

            case MonthNameType.FullNames:
                return(culture.DateTimeFormat.MonthNames);

            case MonthNameType.GenitiveNames:
                return(new string[]
                {
                    new DateTime(2006, 1, 1).ToString("ddMMMM").Substring(2),
                    new DateTime(2006, 2, 1).ToString("ddMMMM").Substring(2),
                    new DateTime(2006, 3, 1).ToString("ddMMMM").Substring(2),
                    new DateTime(2006, 4, 1).ToString("ddMMMM").Substring(2),
                    new DateTime(2006, 5, 1).ToString("ddMMMM").Substring(2),
                    new DateTime(2006, 6, 1).ToString("ddMMMM").Substring(2),
                    new DateTime(2006, 7, 1).ToString("ddMMMM").Substring(2),
                    new DateTime(2006, 8, 1).ToString("ddMMMM").Substring(2),
                    new DateTime(2006, 9, 1).ToString("ddMMMM").Substring(2),
                    new DateTime(2006, 10, 1).ToString("ddMMMM").Substring(2),
                    new DateTime(2006, 11, 1).ToString("ddMMMM").Substring(2),
                    new DateTime(2006, 12, 1).ToString("ddMMMM").Substring(2),
                    ""
                });
            }
            return(null);
        }
Ejemplo n.º 2
0
 private string GetMonthName(MonthNameType monthNameType)
 {
     switch (monthNameType)
     {
         case MonthNameType.JANUARY:
             return "January";
         case MonthNameType.FEBRUARY:
             return "February";
         case MonthNameType.MARCH:
             return "March";
         case MonthNameType.APRIL:
             return "April";
         case MonthNameType.MAY:
             return "May";
         case MonthNameType.JUNE:
             return "June";
         case MonthNameType.JULY:
             return "July";
         case MonthNameType.AUGUST:
             return "August";
         case MonthNameType.SEPTEMBER:
             return "September";
         case MonthNameType.OCTOBER:
             return "Octobor";
         case MonthNameType.NOVEMBER:
             return "November";
         case MonthNameType.DECEMBER:
             return "December";
         default:
             return "January";
     }
 }
Ejemplo n.º 3
0
 public static string[] GetMonthNames(MonthNameType monthNameType)
 {
     return(GetMonthNames(monthNameType, CultureInfo.CurrentUICulture));
 }