Example #1
0
        public void Test_DateChanged()
        {
            GDMDate instance = GDMDate.CreateByFormattedStr("31/11/1980", true);
            //instance.dateChanged();
            string result = instance.GetUDN().ToString();

            Assert.AreEqual("1980/12/01", result);
        }
Example #2
0
        public void Test_GetUDN()
        {
            GDMDate instance = GDMDate.CreateByFormattedStr("20/12/1980", true);
            UDN     result   = instance.GetUDN();

            UDN expResult = new UDN(UDNCalendarType.ctGregorian, 1980, 12, 20);

            Assert.IsTrue(expResult.Equals(result));
            Assert.AreEqual(expResult, result);
        }
Example #3
0
        public override UDN GetUDN()
        {
            UDN result;

            if (fDateFrom.StringValue != "" && fDateTo.StringValue == "")
            {
                result = UDN.CreateAfter(fDateFrom.GetUDN());
            }
            else if (fDateFrom.StringValue == "" && fDateTo.StringValue != "")
            {
                result = UDN.CreateBefore(fDateTo.GetUDN());
            }
            else if (fDateFrom.StringValue != "" && fDateTo.StringValue != "")
            {
                result = UDN.CreateBetween(fDateFrom.GetUDN(), fDateTo.GetUDN());
            }
            else
            {
                result = UDN.CreateEmpty();
            }

            return(result);
        }
Example #4
0
        public static UDN GetUDNByFormattedStr(string dateStr, GDMCalendar calendar, bool aException = false)
        {
            GDMDate dtx = GDMDate.CreateByFormattedStr(dateStr, calendar, aException);

            return((dtx != null) ? dtx.GetUDN() : UDN.CreateEmpty());
        }