public PersianDate AddYears(int years) { PersianDate persianDate = new PersianDate(this.Year, this.Month, this.Day); PersianDate year = persianDate; year.Year = year.Year + years; return persianDate; }
public PersianDate AddMonths(int month) { PersianDate persianDate = new PersianDate(this.Year, this.Month, this.Day); PersianDate persianDate1 = persianDate; persianDate1.Month = persianDate1.Month + month; return persianDate; }
public PersianDate AddYears(int years) { PersianDate persianDate = new PersianDate(this.Year, this.Month, this.Day); PersianDate year = persianDate; year.Year = year.Year + years; return(persianDate); }
public PersianDate AddMonths(int month) { PersianDate persianDate = new PersianDate(this.Year, this.Month, this.Day); PersianDate persianDate1 = persianDate; persianDate1.Month = persianDate1.Month + month; return(persianDate); }
public static PersianDate Parse(string s) { char[] chrArray = new char[] { '-' }; int[] array = s.Split(chrArray).Select<string, int>(new Func<string, int>(int.Parse)).ToArray<int>(); if ((int)array.Length != 3) { throw new FormatException("Invalid format."); } PersianDate persianDate = new PersianDate() { Year = array[0], Month = array[1] }; return persianDate; }
public static PersianDate Parse(string s) { char[] chrArray = new char[] { '-' }; int[] array = s.Split(chrArray).Select <string, int>(new Func <string, int>(int.Parse)).ToArray <int>(); if ((int)array.Length != 3) { throw new FormatException("Invalid format."); } PersianDate persianDate = new PersianDate() { Year = array[0], Month = array[1] }; return(persianDate); }