static DateTime?ExtractEntryDate(Match match, CultureInfo cultureInfo)
        {
            if (match == null)
            {
                throw new ArgumentNullException(nameof(match));
            }

            if (cultureInfo == null)
            {
                throw new ArgumentNullException(nameof(cultureInfo));
            }

            if (!match.Groups["entrydate"].Success)
            {
                return(null);
            }

            var entryYear  = ExtractEntryYear(match);
            var entryMonth = ExtractEntryMonth(match);
            var entryDay   = ExtractEntryDay(match);

            var entryDate = DateParser.ParseDate(entryYear, entryMonth, entryDay, cultureInfo);

            return(entryDate);
        }
Beispiel #2
0
 private static DateTime ParseDate(Match match, CultureInfo cultureInfo)
 {
     return(DateParser.ParseDate
            (
                match.Groups[2].Value,
                match.Groups[3].Value,
                match.Groups[4].Value,
                cultureInfo
            ));
 }
        static DateTime ExtractValueDate(Match match, CultureInfo cultureInfo)
        {
            if (match == null)
            {
                throw new ArgumentNullException(nameof(match));
            }

            if (cultureInfo == null)
            {
                throw new ArgumentNullException(nameof(cultureInfo));
            }

            return(DateParser.ParseDate(match.Groups["year"].Value, match.Groups["month"].Value, match.Groups["day"].Value, cultureInfo));
        }