Bladeren bron

[js] added js.Date.toHaxeDate()

Alexander Kuzmenko 7 jaren geleden
bovenliggende
commit
f0b92870cc
1 gewijzigde bestanden met toevoegingen van 7 en 0 verwijderingen
  1. 7 0
      std/js/Date.hx

+ 7 - 0
std/js/Date.hx

@@ -41,6 +41,13 @@ extern class Date
 		return cast date;
 	}
 
+	/**
+		Cast js.Date to Haxe's Date.
+	**/
+	static public inline function toHaxeDate(date:Date):HaxeDate {
+		return cast date;
+	}
+
 	/**
 		Returns the numeric value corresponding to the current time - the number of milliseconds elapsed since January 1, 1970 00:00:00 UTC, with leap seconds ignored
 	**/