fjgandrade / sharpkit

Automatically exported from code.google.com/p/sharpkit
0 stars 0 forks source link

System.DateTime doesn't compile #222

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
--- C:/windows/temp/DateTime.cs-revBASE.svn000.tmp.cs   Sun Sep 23 12:09:52 2012
+++ C:/Users/Yvan/Desktop/sharpkit/SharpKit.JsClr/System/DateTime.cs    Sun Sep 23 
20:03:32 2012
@@ -69,7 +69,7 @@
         [JsMethod(Name = "Parse$$String")]
         public static DateTime Parse(string str)
         {
-            return new DateTime(JsDate.parse(str));
+            return new DateTime(JsDate.Parse(str));
         }

         [JsMethod(Code = "return 32 - new Date(year, month-1, 32).getDate();")]
@@ -259,7 +259,7 @@
         }
         public static JsImplDateTime operator -(JsImplDateTime t1, TimeSpan t2)
         {
-            return new JsImplDateTime(new JsDate((long)t1.date.getDate() - 
(long)t2.TotalMilliseconds));
+            return new JsImplDateTime(new JsDate((int)((long)t1.date.getDate() 
- (long)t2.TotalMilliseconds)));
         }

         public static TimeSpan operator +(JsImplDateTime t1, JsImplDateTime t2)
@@ -268,7 +268,7 @@
         }
         public static JsImplDateTime operator +(JsImplDateTime t1, TimeSpan t2)
         {
-            return new JsImplDateTime(new JsDate((long)t1.date.getDate() + 
(long)t2.TotalMilliseconds));
+            return new JsImplDateTime(new JsDate((int)((long)t1.date.getDate() 
+ (long)t2.TotalMilliseconds)));
         }

     }

Original issue reported on code.google.com by tworedce...@gmail.com on 24 Sep 2012 at 12:06

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by yvan.rod...@gmail.com on 25 Sep 2012 at 4:52

GoogleCodeExporter commented 9 years ago
This was fixed by sebastian in r1024, trunk now compiles:

Index: javascript-1.5.cs
===================================================================
--- javascript-1.5.cs   (revision 1023)
+++ javascript-1.5.cs   (revision 1024)
@@ -1001,7 +1001,7 @@
     {
         public static JsNumber operator -(JsDate date1, JsDate date2) { return default(JsNumber); }
         public JsDate() { }
-        public JsDate(int value) { }
+        public JsDate(long value) { }
         public JsDate(JsString value) { }
         public JsDate(int year, int month, int date) { }
         public JsDate(int year, int month, int date, int hours) { }
@@ -1445,7 +1445,7 @@
         ///<param name="dateVal">Either a JsString containing a date in a format such as "Jan 5, 1996 08:47:00" or a VT_DATE value retrieved from an ActiveX® object or other object.</param>
         ///<returns>An integer value representing the number of milliseconds between midnight, January 1, 1970 and the date supplied in dateVal.</returns>
         [JsMethod(NativeOverloads = true)]
-        public static JsNumber Parse(JsString dateVal) { return 
default(JsNumber); }
+        public static JsNumber parse(JsString dateVal) { return 
default(JsNumber); }
         ///<summary>
         ///Sets the numeric day-of-the-month value of the Date object using local time.
         ///</summary>

Original comment by yvan.rod...@gmail.com on 2 Oct 2012 at 10:14