Esempio n. 1
0
        public static TokenDeterminateSeries GetSeriesFromTokens(TokenEach each, TokenOrdinal ordinal, TokenInt year)
        {
            var endDate = new DateTime((int)year.Value + 1, 1, 1).AddDays(-1);
            var startDate = new DateTime((int)year.Value, 1, (int)ordinal.Value);

            var series = new TokenDeterminateSeries
            {
                EndDate = endDate,
                Interval = (int)ordinal.Value,
                IntervalType = TokenDeterminateSeries.SeriesIntervalType.DayOfMonth,
                StartDate = startDate,
                Value = ordinal.Value
            };
            return series;
        }
Esempio n. 2
0
        public static TokenDeterminateSeries GetSeriesFromTokens(TokenEach each, TokenOther other, TokenDayOfWeek dow, TokenInt year)
        {
            var endDate = new DateTime((int)year.Value + 1, 1, 1).AddDays(-1);
            var startDate = GetFirstDowOfYear((int)year.Value, ((DateTime)dow.Value).DayOfWeek);

            var series = new TokenDeterminateSeries
            {
                EndDate = endDate,
                Interval = 2,
                IntervalType = TokenDeterminateSeries.SeriesIntervalType.DayOfWeek,
                StartDate = startDate,
                Value = dow.Value
            };
            return series;
        }