예제 #1
0
        public static DayOfWeek DayOfWeekend(PersianDate date)
        {
            PersianCalendar p    = new PersianCalendar();
            var             temp = ToGregorianDate(date);

            return(p.GetDayOfWeek(temp));
        }
예제 #2
0
        public static string DayOfWeekString(PersianDate date)
        {
            DayOfWeek temp = DayOfWeekend(date);

            switch (temp)
            {
            case DayOfWeek.Saturday: return("شنبه");

            case DayOfWeek.Sunday: return("یکشنبه");

            case DayOfWeek.Monday: return("دوشنبه");

            case DayOfWeek.Tuesday: return("سه شنبه");

            case DayOfWeek.Wednesday: return("چهارشنبه");

            case DayOfWeek.Thursday: return("پنجشنبه");

            case DayOfWeek.Friday: return("جمعه");
            }

            return("");
        }
예제 #3
0
        public static DateTime ToGregorianDate(PersianDate date)
        {
            PersianCalendar p = new PersianCalendar();

            return(p.ToDateTime(date.Year, date.Month, date.Day, date.Hour, date.Minute, date.Second, (int)date.Millisecond));
        }