예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }
예제 #4
0
        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));
        }
예제 #5
0
        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));
        }
예제 #6
0
        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));
        }
예제 #7
0
        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);
        }
예제 #8
0
        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);
        }
예제 #9
0
        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);
        }
예제 #10
0
        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));
        }