2005-09-01 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Thu, 1 Sep 2005 16:52:30 +0000 (16:52 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Thu, 1 Sep 2005 16:52:30 +0000 (16:52 -0000)
* DateTime.cs : another idiotic COM dependent format.

* DateTimeTest.cs : another COM dependent idiotic parse.

svn path=/trunk/mcs/; revision=49279

mcs/class/corlib/System/ChangeLog
mcs/class/corlib/System/DateTime.cs
mcs/class/corlib/Test/System/ChangeLog
mcs/class/corlib/Test/System/DateTimeTest.cs

index a02c2785c43366cc536ad75742f90a464c8961dd..2b8750367311430f2c99d8e1d00172ab94a068af 100644 (file)
@@ -1,3 +1,7 @@
+2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * DateTime.cs : another idiotic COM dependent format.
+
 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
 
        * __ComObject.cs: Fixed to be internal. Removed CLSCompliant attribute.
index 7a3704c7966e4b8a98662b30087c63c342ef9152..3dacd5485d34be0d84d5b3f91fb147b284d84bb9 100644 (file)
@@ -114,6 +114,8 @@ namespace System
 
                        // bug #60912
                        "M/d/yyyy HH':'mm':'ss tt",
+                       // another funky COM dependent one
+                       "dd-MMM-yy",
 
                        // DayOfTheWeek, dd full_month_name yyyy
                        // FIXME: 1054(th-TH) rejects it
index 874cb7c8cc8bbb4f62a2b32a95cbe3c6bc090edb..f6387bae15f347c0a3ec288837758d865d81d40a 100644 (file)
@@ -1,3 +1,7 @@
+2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * DateTimeTest.cs : another COM dependent idiotic parse.
+
 2005-08-19  Gert Driesen <drieseng@users.sourceforge.net>
 
        * ConvertTest.cs: FromBase64String always return zero-length byte 
index 2eba37a523b587e3a81bad8dea8b0dc04b7b7651..1b07004821134bee9f60c481a3519bcebfdbf307 100644 (file)
@@ -749,9 +749,10 @@ public class DateTimeTest : Assertion
                AssertEquals (02, dt.Month);
                AssertEquals (21, dt.Day);
 
-               // see also bug #53023
-               foreach (CultureInfo ci in CultureInfo.GetCultures (CultureTypes.SpecificCultures))
-                       DateTime.Parse ("8/16/2005", ci);
+               foreach (CultureInfo ci in CultureInfo.GetCultures (CultureTypes.SpecificCultures)) {
+                       DateTime.Parse ("8/16/2005", ci); // see also bug #53023
+                       DateTime.Parse ("01-Sep-05", ci);
+               }
 
                // don't allow 2 digit years where we require 4.
                try {
@@ -768,6 +769,7 @@ public class DateTimeTest : Assertion
                DateTime.Parse (String.Format (
                        "{0}\u5E74{1}\u6708{2}\u65E5 {3}\u6642{4}\u5206{5}\u79D2",
                        2006, 3, 1, 15, 32, 42), new CultureInfo (""));
+
                try {
                        // incorrect year mark.
                        DateTime.Parse (String.Format (
@@ -782,7 +784,11 @@ public class DateTimeTest : Assertion
        [ExpectedException(typeof (FormatException))]
        public void ParseFormatException1 ()
        {
-               // Following string is not a correct French date i.e. dd/mm/yyyy.
+               // Following string is not a correct French date i.e.
+               // MM/dd/yyyy HH:mm:ss since it expects d/M/yyyy HH:mm:ss
+               // instead (however fr-FR accepts both MM/dd/yyyy and
+               // dd/MM/yyyy, which means that we can't just throw exceptions 
+               // on overflow).
                String frDateTime = "11/13/2003 11:28:15";
                IFormatProvider format = new CultureInfo("fr-FR", true);
                DateTime t1 = DateTime.Parse(frDateTime, format);