示例#1
0
        public static IExtendedDateTimeIndependentType Parse(string EDTFtedString)
        {
            if (string.IsNullOrEmpty(EDTFtedString))
            {
                throw new ParseException("The input string cannot be empty.", EDTFtedString);
            }

            if (EDTFtedString.Contains('/'))
            {
                return(ExtendedDateTimeIntervalParser.Parse(EDTFtedString));
            }

            if (EDTFtedString[0] == '{')
            {
                return(ExtendedDateTimeCollectionParser.Parse(EDTFtedString));
            }
            else if (EDTFtedString[0] == '[')
            {
                return(ExtendedDateTimePossibilityCollectionParser.Parse(EDTFtedString));
            }
            else if (EDTFtedString.ContainsBefore('u', '^'))
            {
                return(UnspecifiedExtendedDateTimeParser.Parse(EDTFtedString));
            }
            else if (EDTFtedString.ContainsBefore('x', '^'))
            {
                return(ExtendedDateTimeMaskedPrecisionParser.Parse(EDTFtedString));
            }
            else
            {
                return(ExtendedDateTimeParser.Parse(EDTFtedString));
            }
        }
        internal static ExtendedDateTimeInterval Parse(string extendedDateTimeIntervalString, ExtendedDateTimeInterval extendedDateTimeInterval = null)
        {
            if (string.IsNullOrWhiteSpace(extendedDateTimeIntervalString))
            {
                return(null);
            }

            return(ExtendedDateTimeIntervalParser.Parse(extendedDateTimeIntervalString, extendedDateTimeInterval));
        }
        public static ExtendedDateTimeInterval Parse(string extendedDateTimeIntervalString)
        {
            if (string.IsNullOrWhiteSpace(extendedDateTimeIntervalString))
            {
                return(null);
            }

            return(ExtendedDateTimeIntervalParser.Parse(extendedDateTimeIntervalString));
        }