Browse Source

[python] add total_seconds for TimeDelta (also clean up syntax a bit)

Dan Korostelev 10 năm trước cách đây
mục cha
commit
08fce8c39a
1 tập tin đã thay đổi với 6 bổ sung8 xóa
  1. 6 8
      std/python/lib/datetime/TimeDelta.hx

+ 6 - 8
std/python/lib/datetime/TimeDelta.hx

@@ -1,18 +1,16 @@
-
 package python.lib.datetime;
 
 @:pythonImport("datetime", "timedelta")
 extern class TimeDelta {
 
-	public static var min : TimeDelta;
-	public static var max : TimeDelta;
-	public static var resolution : TimeDelta;
-
+	static var min : TimeDelta;
+	static var max : TimeDelta;
+	static var resolution : TimeDelta;
 
 	var days : Int;
-
 	var seconds : Int;
 	var microseconds : Int;
 
-	public function new(days:Int = 0, seconds:Int = 0, microseconds:Int = 0, milliseconds:Int = 0, minutes:Int = 0, hours:Int = 0, weeks:Int = 0):Void;
-}
+	function new(days:Int = 0, seconds:Int = 0, microseconds:Int = 0, milliseconds:Int = 0, minutes:Int = 0, hours:Int = 0, weeks:Int = 0):Void;
+	function total_seconds():Float;
+}