/// <summary> /// ساخت کیبورد شامل ماه های شمسی /// </summary> /// <param name="defaltMonth">ماه پیش فرض</param> /// <returns>کیبورد ماه های شمسی</returns> public static InlineKeyboardMarkup makeMonthKeyboard(int defaltMonth = -1) { string[] monthArr = new string[12]; for (int i = 0; i < 12; i++) { monthArr[i] = PersianDateTime.GetMonthName(i - 1) + (i == defaltMonth - 1 ? " \U00002705" : ""); } return(makeKeyboard(monthArr, 3, false)); }
public void ShowAllDate() { Console.WriteLine(DateHelper.GetStartOfDayFa().ToFa("YYYY/MM/d hh:mm:ss")); Console.WriteLine(DateHelper.GetStartOfWeekFa().ToFa("YYYY/MM/d hh:mm:ss")); Console.WriteLine(DateHelper.GetStartOfMonthFa().ToFa("YYYY/MM/d hh:mm:ss")); Console.WriteLine(DateHelper.GetStartOfYearFa().ToFa("YYYY/MM/d hh:mm:ss")); Console.WriteLine(PersianDateTime.GetMonthName(-1)); Console.WriteLine(PersianDateTime.GetDaysInMonth(PersianDateTime.Now.Year, PersianDateTime.Now.Month)); }
private static List <ChartData> FillEmptyFaMonthes(this List <ChartData> retVal) { for (var i = -1; i <= 10; i++) { var monthName = PersianDateTime.GetMonthName(i); if (retVal.All(x => x.Range != monthName)) { retVal.Add(new ChartData() { Count = 0, Range = monthName, Order = i }); } else { retVal.First(x => x.Range == monthName).Order = i; } } return(retVal); }