Esempio n. 1
0
        private NthDayOfWeekBuilder Ordinal(DayOfWeek day, string ordinal)
        {
            GrammarChecker.CheckGrammar(Configuration.N, ordinal);

            Configuration.DayOfWeek = day;
            return(new NthDayOfWeekBuilder(Configuration));
        }
Esempio n. 2
0
        private AtBuilder OrdinalOfTheMonth(string ordinal)
        {
            GrammarChecker.CheckGrammar(Configuration.N, ordinal);

            var first = Configuration.First;

            first = new DateTimeOffset(first.Year, first.Month, Configuration.N, first.Hour, first.Minute, first.Second, first.Offset);

            if (first < DateTimeOffset.Now)
            {
                first = first.AddMonths(1);
            }

            Configuration.First = first;

            Configuration.CalculateNext = next =>
            {
                next = next.AddMonths(1);

                return(next);
            };

            return(new AtBuilder(Configuration));
        }