public void Can_Convert_To_Written() { PersianDate pd = new PersianDate("1384/1/1"); string written = pd.ToWritten(); Assert.AreEqual(string.Format("{0} {1} {2} {3}", pd.LocalizedWeekDayName, pd.Day, pd.LocalizedMonthName, pd.Year), written); }
private void btnDeductDays(object sender, EventArgs e) { PersianDate pd = new PersianDate(calendar.AddDays(DateTime.Now, -66)); lblMessage.Text = pd.ToString(); lblToWritten.Text = pd.ToWritten(); }
private void btnAddMonth_Click(object sender, EventArgs e) { PersianDate pd = new PersianDate(calendar.AddMonths(DateTime.Now, 2)); lblMessage.Text = pd.ToString(); lblToWritten.Text = pd.ToWritten(); }
private void btnToday_Click(object sender, EventArgs e) { PersianDate pd = PersianDate.Now; lblMessage.Text = pd.ToString(); lblToWritten.Text = pd.ToWritten(); }
protected override string FormatDateValue(DateTime date, DateTimeFormatInfo dateTimeFormat) { if (CultureInfo.CurrentUICulture.Name.Equals("fa-ir", StringComparison.InvariantCultureIgnoreCase)) { PersianDate pd = date.ToPersianDate(); return(pd.ToWritten()); } return(date.ToString("D")); }
private void btnAddYears_Click(object sender, EventArgs e) { PersianDate pd = new PersianDate(calendar.AddYears(DateTime.Now, 10)); lblMessage.Text = pd.ToString(); lblToWritten.Text = pd.ToWritten(); }