Author: atsushi
Date: 2005-05-24 16:07:11 -0400 (Tue, 24 May 2005)
New Revision: 44940
Modified:
trunk/mcs/class/corlib/System/ChangeLog
trunk/mcs/class/corlib/System/DateTime.cs
trunk/mcs/class/corlib/Test/System/ChangeLog
trunk/mcs/class/corlib/Test/System/DateTimeTest.cs
Log:
2005-05-24 Atsushi Enomoto <[EMAIL PROTECTED]>
* DateTime.cs : HH should not always block tt. Fixed bug #60912.
Reset num after whitespace parsing.
Added "M/d/yyyy HH':'mm':'ss tt" as an invariant pattern.
* DateTimeTest.cs : testcase for #60912.
Modified: trunk/mcs/class/corlib/System/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System/ChangeLog 2005-05-24 19:27:21 UTC (rev
44939)
+++ trunk/mcs/class/corlib/System/ChangeLog 2005-05-24 20:07:11 UTC (rev
44940)
@@ -1,5 +1,11 @@
2005-05-24 Atsushi Enomoto <[EMAIL PROTECTED]>
+ * DateTime.cs : HH should not always block tt. Fixed bug #60912.
+ Reset num after whitespace parsing.
+ Added "M/d/yyyy HH':'mm':'ss tt" as an invariant pattern.
+
+2005-05-24 Atsushi Enomoto <[EMAIL PROTECTED]>
+
* DateTime.cs : Allow ',' where whitespaces are allowed.
Fixed bug #71289.
Modified: trunk/mcs/class/corlib/System/DateTime.cs
===================================================================
--- trunk/mcs/class/corlib/System/DateTime.cs 2005-05-24 19:27:21 UTC (rev
44939)
+++ trunk/mcs/class/corlib/System/DateTime.cs 2005-05-24 20:07:11 UTC (rev
44940)
@@ -112,6 +112,9 @@
// FIXME: 1078(af-ZA) and 1079(ka-GE) reject it
"yyyy/MM/dd HH':'mm':'ssZ",
+ // bug #60912
+ "M/d/yyyy HH':'mm':'ss tt",
+
// DayOfTheWeek, dd full_month_name yyyy
// FIXME: 1054(th-TH) rejects it
"dddd, dd MMMM yyyy",
@@ -917,6 +920,7 @@
} else if (Char.IsWhiteSpace (s [valuePos]) ||
s [valuePos] == ',' &&
Char.IsWhiteSpace (chars [pos])) {
valuePos++;
+ num = 0;
if (exact && (style &
DateTimeStyles.AllowInnerWhite) == 0) {
if (!Char.IsWhiteSpace
(chars[pos]))
return false;
@@ -943,12 +947,12 @@
continue;
}
-
if ((pos+num+1 < len) && (chars[pos+num+1] ==
chars[pos+num])) {
num++;
continue;
}
+
int num_parsed = 0;
if (pos+num+1 < len) {
@@ -1054,7 +1058,7 @@
if (hour >= 24)
return false;
- ampm = -2;
+// ampm = -2;
break;
case 'm':
if (minute != -1)
Modified: trunk/mcs/class/corlib/Test/System/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/Test/System/ChangeLog 2005-05-24 19:27:21 UTC
(rev 44939)
+++ trunk/mcs/class/corlib/Test/System/ChangeLog 2005-05-24 20:07:11 UTC
(rev 44940)
@@ -1,5 +1,9 @@
2005-05-24 Atsushi Enomoto <[EMAIL PROTECTED]>
+ * DateTimeTest.cs : testcase for #60912.
+
+2005-05-24 Atsushi Enomoto <[EMAIL PROTECTED]>
+
* DateTimeTest.cs : testcase for #71289.
2005-05-21 Ben Maurer <[EMAIL PROTECTED]>
Modified: trunk/mcs/class/corlib/Test/System/DateTimeTest.cs
===================================================================
--- trunk/mcs/class/corlib/Test/System/DateTimeTest.cs 2005-05-24 19:27:21 UTC
(rev 44939)
+++ trunk/mcs/class/corlib/Test/System/DateTimeTest.cs 2005-05-24 20:07:11 UTC
(rev 44940)
@@ -354,17 +354,25 @@
}
[Category ("NotWorking")]
- public void TestParseExact3 ()
- {
+ public void TestParseExact3 ()
+ {
DateTime t1 = DateTime.ParseExact ("2002-02-25 04:25:13Z", "u",
null);
AssertEquals ("D07a", 2002, t1.Year);
AssertEquals ("D07b", 02, t1.Month);
AssertEquals ("D07c", 25, t1.Day);
AssertEquals ("D07e", 25, t1.Minute);
AssertEquals ("D07f", 13, t1.Second);
- }
-
-
+ }
+
+ [Test]
+ // bug #60912, modified hour as 13:00
+ public void TestParseExact4 ()
+ {
+ string s = "6/28/2004 13:00:00 AM";
+ string f = "M/d/yyyy HH':'mm':'ss tt";
+ DateTime.ParseExact (s, f, CultureInfo.InvariantCulture);
+ }
+
public void TestParseExact ()
{
// Standard patterns
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches