Parcourir la source

[js] added js.Date.toHaxeDate()

Alexander Kuzmenko il y a 7 ans
Parent
commit
f0b92870cc
1 fichiers modifiés avec 7 ajouts et 0 suppressions
  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
 	**/