예제 #1
0
        /// <summary>
        /// Returns the <see cref="RataDie"/> of the <paramref name="dayOfWeek"/> before a fixed date,
        /// represented by the instance.
        /// </summary>
        /// <param name="dayOfWeek">The day of the week to search for.</param>
        /// <returns>An <see cref="RataDie"/>, before the instance date.</returns>
        public RataDie DayBefore(DayOfWeek dayOfWeek)
        {
            RataDie yesterdayDate = null;

            yesterdayDate = new RataDie();
            yesterdayDate.Days = Days - 1;
            return yesterdayDate.DayOnOrBefore(dayOfWeek);
        }
예제 #2
0
        /// <summary>
        /// Returns the <see cref="RataDie"/> of the <paramref name="dayOfWeek"/> nearest to a fixed date,
        /// represented by the instance.
        /// </summary>
        /// <param name="dayOfWeek">The day of the week to search for.</param>
        /// <returns>An <see cref="RataDie"/>, after the instance date.</returns>
        public RataDie DayNearest(DayOfWeek dayOfWeek)
        {
            RataDie halfNextWeekDate = null;

            halfNextWeekDate = new RataDie();
            halfNextWeekDate.Days = Days + 3;
            return halfNextWeekDate.DayOnOrBefore(dayOfWeek);
        }
예제 #3
0
        /// <summary>
        /// Returns the <see cref="RataDie"/> of the <paramref name="dayOfWeek"/> after a fixed date,
        /// represented by the instance.
        /// </summary>
        /// <param name="dayOfWeek">The day of the week to search for.</param>
        /// <returns>An <see cref="RataDie"/>, after the instance date.</returns>
        public RataDie DayAfter(DayOfWeek dayOfWeek)
        {
            RataDie nextWeekDate = null;

            nextWeekDate = new RataDie();
            nextWeekDate.Days = Days + 7;
            return nextWeekDate.DayOnOrBefore(dayOfWeek);
        }
예제 #4
0
        /// <summary>
        /// Returns the <see cref="RataDie"/> of the <paramref name="dayOfWeek"/> after a fixed date,
        /// represented by the instance.
        /// </summary>
        /// <param name="dayOfWeek">The day of the week to search for.</param>
        /// <returns>An <see cref="RataDie"/>, after the instance date.</returns>
        public RataDie DayAfter(DayOfWeek dayOfWeek)
        {
            RataDie nextWeekDate = null;

            nextWeekDate      = new RataDie();
            nextWeekDate.Days = Days + 7;
            return(nextWeekDate.DayOnOrBefore(dayOfWeek));
        }
예제 #5
0
        /// <summary>
        /// Returns the <see cref="RataDie"/> of the <paramref name="dayOfWeek"/> before a fixed date,
        /// represented by the instance.
        /// </summary>
        /// <param name="dayOfWeek">The day of the week to search for.</param>
        /// <returns>An <see cref="RataDie"/>, before the instance date.</returns>
        public RataDie DayBefore(DayOfWeek dayOfWeek)
        {
            RataDie yesterdayDate = null;

            yesterdayDate      = new RataDie();
            yesterdayDate.Days = Days - 1;
            return(yesterdayDate.DayOnOrBefore(dayOfWeek));
        }
예제 #6
0
        /// <summary>
        /// Returns the <see cref="RataDie"/> of the <paramref name="dayOfWeek"/> nearest to a fixed date,
        /// represented by the instance.
        /// </summary>
        /// <param name="dayOfWeek">The day of the week to search for.</param>
        /// <returns>An <see cref="RataDie"/>, after the instance date.</returns>
        public RataDie DayNearest(DayOfWeek dayOfWeek)
        {
            RataDie halfNextWeekDate = null;

            halfNextWeekDate      = new RataDie();
            halfNextWeekDate.Days = Days + 3;
            return(halfNextWeekDate.DayOnOrBefore(dayOfWeek));
        }
예제 #7
0
        /// <summary>
        /// Returns the <see cref="RataDie"/> of the <paramref name="dayOfWeek"/> on or after a fixed date,
        /// represented by the instance.
        /// </summary>
        /// <param name="dayOfWeek">The day of the week to search for.</param>
        /// <returns>An <see cref="RataDie"/>, on or after the instance date.</returns>
        public RataDie DayOnOrAfter(DayOfWeek dayOfWeek)
        {
            RataDie laterDate = null;

            laterDate      = new RataDie();
            laterDate.Days = Days + 6;
            return(laterDate.DayOnOrBefore(dayOfWeek));
        }
예제 #8
0
        /// <summary>
        /// Returns the <see cref="RataDie"/> of the <paramref name="dayOfWeek"/> on or after a fixed date,
        /// represented by the instance.
        /// </summary>
        /// <param name="dayOfWeek">The day of the week to search for.</param>
        /// <returns>An <see cref="RataDie"/>, on or after the instance date.</returns>
        public RataDie DayOnOrAfter(DayOfWeek dayOfWeek)
        {
            RataDie laterDate = null;

            laterDate = new RataDie();
            laterDate.Days = Days + 6;
            return laterDate.DayOnOrBefore(dayOfWeek);
        }