public override string GetDisplayStringExt(DateFormat format, bool sign, bool showCalendar) { string result = ""; if (fDateFrom.StringValue != "" && fDateTo.StringValue == "") { result = fDateFrom.GetDisplayString(format, true, showCalendar); if (sign) { result += " >"; } } else if (fDateFrom.StringValue == "" && fDateTo.StringValue != "") { result = fDateTo.GetDisplayString(format, true, showCalendar); if (sign) { result = "< " + result; } } else if (fDateFrom.StringValue != "" && fDateTo.StringValue != "") { result = fDateFrom.GetDisplayString(format, true, showCalendar) + " - " + fDateTo.GetDisplayString(format, true, showCalendar); } return(result); }
public void Test_GetDisplayString_DateFormat() { GDMDate instance = GDMDate.CreateByFormattedStr("20/12/1980", true); string result = instance.GetDisplayString(DateFormat.dfYYYY_MM_DD); Assert.AreEqual("1980.12.20", result); result = instance.GetDisplayString(DateFormat.dfDD_MM_YYYY); Assert.AreEqual("20.12.1980", result); result = instance.GetDisplayString(DateFormat.dfYYYY); Assert.AreEqual("1980", result); }
public void Test_GetDisplayString_3args() { GDMDate instance = new GDMDate(null); instance.SetJulian(20, 12, 1980); instance.YearBC = true; string result = instance.GetDisplayString(DateFormat.dfYYYY_MM_DD, true, true); Assert.AreEqual("BC 1980.12.20 [J]", result); result = instance.GetDisplayString(DateFormat.dfDD_MM_YYYY, true, false); Assert.AreEqual("20.12.1980 BC", result); result = instance.GetDisplayString(DateFormat.dfYYYY, true, false); Assert.AreEqual("BC 1980", result); }
public void Test_SetJulian_4args() { GDMDate instance = new GDMDate(null); instance.SetJulian(20, "DEC", 1980, false); Assert.AreEqual("1980.12.20", instance.GetDisplayString(DateFormat.dfYYYY_MM_DD, false, false)); }
public void Test_SetGregorian_5argsBC() { GDMDate instance = new GDMDate(null); instance.SetGregorian(20, "Dec", 1980, "", true); Assert.AreEqual("BC 1980.12.20", instance.GetDisplayString(DateFormat.dfYYYY_MM_DD, true, false)); }
public void Test_SetGregorian_3args() { GDMDate instance = new GDMDate(); instance.SetGregorian(20, 12, 1980); Assert.AreEqual("1980.12.20", instance.GetDisplayString(DateFormat.dfYYYY_MM_DD, false, false)); }
public void Test_SetDateHebrew() { GDMDate instance = new GDMDate(null); instance.SetDate(GDMCalendar.dcHebrew, 20, 12, 1980); Assert.AreEqual("1980.12.20", instance.GetDisplayString(DateFormat.dfYYYY_MM_DD, false, false)); Assert.AreEqual("@#DHEBREW@ 20 AAV 1980", instance.StringValue); }
public void Test_SetDateFrench() { GDMDate instance = new GDMDate(null); instance.SetDate(GDMCalendar.dcFrench, 20, 12, 1980); Assert.AreEqual("1980.12.20", instance.GetDisplayString(DateFormat.dfYYYY_MM_DD, false, false)); Assert.AreEqual("@#DFRENCH R@ 20 FRUC 1980", instance.StringValue); }
public void Test_SetDateJulian() { GDMDate instance = new GDMDate(null); instance.SetDate(GDMCalendar.dcJulian, 20, 12, 1980); Assert.AreEqual("1980.12.20", instance.GetDisplayString(DateFormat.dfYYYY_MM_DD, false, false)); Assert.AreEqual("@#DJULIAN@ 20 DEC 1980", instance.StringValue); }
public void Test_GetDisplayString_DateFormat_boolean() { GDMDate instance = GDMDate.CreateByFormattedStr("20/12/1980", true); Assert.AreEqual("20.12.1980", instance.GetDisplayString(DateFormat.dfDD_MM_YYYY, false)); }