예제 #1
0
        /// <summary>
        /// 匹配班期
        /// </summary>
        private static bool MatchFlightWeek(DateTime flightDate, string weekFilter, string separator)
        {
            var includeWeeks = DateResolver.GetWeeks(weekFilter, separator);

            // 2012-11-02 deng.zhao修改
            // return !includeWeeks.Any() || includeWeeks.Contains(flightDate.DayOfWeek);
            return(includeWeeks.Contains(flightDate.DayOfWeek));
        }
예제 #2
0
        /// <summary>
        /// 判断在从起始日期起,到结束日期止的时间段内,在排除掉以分隔符分隔的排除日期字串转换的日期后,起飞日期是否包含在内,即有效;
        /// </summary>
        /// <param name="flightDate">航行日期</param>
        /// <param name="start">起始日期</param>
        /// <param name="end">结束日期</param>
        /// <param name="filter">排除日期字符串</param>
        /// <param name="separator">分隔符</param>
        /// <returns>是否包含</returns>
        private static bool MatchFlightDate(DateTime flightDate, DateTime start, DateTime end, string filter, string separator)
        {
            var excludeDates = DateResolver.GetDates(start, end, filter, separator);

            return(!excludeDates.Contains(flightDate));
        }