Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        private void btnDeductDays(object sender, EventArgs e)
        {
            PersianDate pd = new PersianDate(calendar.AddDays(DateTime.Now, -66));

            lblMessage.Text   = pd.ToString();
            lblToWritten.Text = pd.ToWritten();
        }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
        private void btnToday_Click(object sender, EventArgs e)
        {
            PersianDate pd = PersianDate.Now;

            lblMessage.Text   = pd.ToString();
            lblToWritten.Text = pd.ToWritten();
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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"));
        }
Ejemplo n.º 7
0
 private void btnDeductDays(object sender, EventArgs e)
 {
     PersianDate pd = new PersianDate(calendar.AddDays(DateTime.Now, -66));
     lblMessage.Text = pd.ToString();
     lblToWritten.Text = pd.ToWritten();
 }
Ejemplo n.º 8
0
 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();
 }