Example #1
0
            public CALDate DateAdvance(CALDate today, string periodrepr, string covrepr = "Following", bool endOfMonth = false)
            {
                Period period = PeriodParser.parse(periodrepr);
                BusinessDayConvention conv = Utilities.parseBizDayConv(covrepr);
                Date calDate = innerCal_.advance(today.innerDate_, period, conv, endOfMonth);

                return(new CALDate(calDate.serialNumber()));
            }
Example #2
0
        public void CanParseWithTime()
        {
            var period = PeriodParser.Parse("P1Y2M3DT4H5M6S");

            Assert.Equal(1, period.Years);
            Assert.Equal(2, period.Months);
            Assert.Equal(3, period.Days);
            Assert.Equal(4, period.Hours);
            Assert.Equal(5, period.Minutes);
            Assert.Equal(6, period.Seconds);
        }
Example #3
0
        public void CanParseWithoutTime()
        {
            var period = PeriodParser.Parse("P1Y2M3D");

            Assert.Equal(1, period.Years);
            Assert.Equal(2, period.Months);
            Assert.Equal(3, period.Days);
            Assert.Equal(0, period.Hours);
            Assert.Equal(0, period.Minutes);
            Assert.Equal(0, period.Seconds);
        }
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PeriodParser obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
Example #5
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PeriodParser obj) {
   return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
 }
Example #6
0
        public void CanParseEmpty()
        {
            var period = PeriodParser.Parse(string.Empty);

            Assert.Equal(Period.Zero, period);
        }
Example #7
0
 public virtual PeriodParser SetNext(PeriodParser next)
 {
     NextParser = next;
     return(next);
 }