You've already forked linux-packaging-mono
Imported Upstream version 4.0.1.28
Former-commit-id: d8405b75d12c6845dab8fe08c1576f57a148d621
This commit is contained in:
@@ -2,6 +2,8 @@ Assembly/AssemblyInfo.cs
|
||||
../../build/common/Consts.cs
|
||||
../../build/common/Locale.cs
|
||||
../../build/common/MonoTODOAttribute.cs
|
||||
../../../external/referencesource/System.Xml/System/Xml/Bits.cs
|
||||
System.Xml/XsdDateTime2.cs
|
||||
Mono.Xml.Schema/XmlSchemaValidatingReader.cs
|
||||
Mono.Xml.Schema/XsdIdentityPath.cs
|
||||
Mono.Xml.Schema/XsdIdentityState.cs
|
||||
|
||||
@@ -290,7 +290,16 @@ namespace System.Xml {
|
||||
//return DateTime.Parse(s, d);
|
||||
DateTimeStyles style = DateTimeStyles.AllowLeadingWhite |
|
||||
DateTimeStyles.AllowTrailingWhite;
|
||||
return DateTime.ParseExact (s, format, DateTimeFormatInfo.InvariantInfo, style);
|
||||
try {
|
||||
return DateTime.ParseExact (s, format, DateTimeFormatInfo.InvariantInfo, style);
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
var xsdDateTime = new XsdDateTime2 (s, XsdDateTimeFlags.AllXsd);
|
||||
return (DateTime) xsdDateTime;
|
||||
} catch {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static DateTime ToDateTime(string s, string[] formats)
|
||||
@@ -304,6 +313,13 @@ namespace System.Xml {
|
||||
return DateTime.ParseExact (s, formats, DateTimeFormatInfo.InvariantInfo, style);
|
||||
} catch (ArgumentOutOfRangeException) {
|
||||
return DateTime.MinValue;
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
var xsdDateTime = new XsdDateTime2 (s, XsdDateTimeFlags.AllXsd);
|
||||
return (DateTime) xsdDateTime;
|
||||
} catch {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -781,15 +797,35 @@ namespace System.Xml {
|
||||
|
||||
public static DateTimeOffset ToDateTimeOffset (string s, string format)
|
||||
{
|
||||
return DateTimeOffset.ParseExact (s, format, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal);
|
||||
try {
|
||||
return DateTimeOffset.ParseExact (s, format, CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal);
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
var xsdDateTime = new XsdDateTime2 (s, XsdDateTimeFlags.AllXsd);
|
||||
return (DateTimeOffset) xsdDateTime;
|
||||
} catch {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static DateTimeOffset ToDateTimeOffset (string s, string [] formats)
|
||||
{
|
||||
DateTimeStyles style = DateTimeStyles.AllowLeadingWhite |
|
||||
try {
|
||||
DateTimeStyles style = DateTimeStyles.AllowLeadingWhite |
|
||||
DateTimeStyles.AllowTrailingWhite |
|
||||
DateTimeStyles.AssumeUniversal;
|
||||
return DateTimeOffset.ParseExact (s, formats, CultureInfo.InvariantCulture, style);
|
||||
return DateTimeOffset.ParseExact (s, formats, CultureInfo.InvariantCulture, style);
|
||||
} catch (Exception e) {
|
||||
try {
|
||||
var xsdDateTime = new XsdDateTime2 (s, XsdDateTimeFlags.AllXsd);
|
||||
return (DateTimeOffset) xsdDateTime;
|
||||
} catch {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static string ToString (DateTimeOffset value)
|
||||
|
||||
993
mcs/class/System.XML/System.Xml/XsdDateTime2.cs
Normal file
993
mcs/class/System.XML/System.Xml/XsdDateTime2.cs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -371,4 +371,6 @@ System.Xml.Serialization/XmlElementEventHandler.cs
|
||||
System.Xml.Serialization/XmlNodeEventHandler.cs
|
||||
|
||||
System.Xml/XQueryConvert.cs
|
||||
../../../external/referencesource/System.Xml/System/Xml/Bits.cs
|
||||
System.Xml/XsdDateTime2.cs
|
||||
|
||||
|
||||
Reference in New Issue
Block a user