|
@@ -30,12 +30,18 @@ extern class Date
|
|
function toString():String;
|
|
function toString():String;
|
|
|
|
|
|
static function now() : Date;
|
|
static function now() : Date;
|
|
|
|
+ static function fromTime( t : Float ) : Date;
|
|
|
|
|
|
private static function __init__() : Void untyped {
|
|
private static function __init__() : Void untyped {
|
|
#if js
|
|
#if js
|
|
Date.now = function() {
|
|
Date.now = function() {
|
|
return __new__(Date);
|
|
return __new__(Date);
|
|
};
|
|
};
|
|
|
|
+ Date.fromTime = function(t){
|
|
|
|
+ var d = __new__(Date);
|
|
|
|
+ d.setTime( t );
|
|
|
|
+ return d;
|
|
|
|
+ };
|
|
Date.prototype.toString = function() {
|
|
Date.prototype.toString = function() {
|
|
var m = this.getMonth() + 1;
|
|
var m = this.getMonth() + 1;
|
|
var d = this.getDate();
|
|
var d = this.getDate();
|
|
@@ -58,6 +64,11 @@ extern class Date
|
|
Date.now = function() {
|
|
Date.now = function() {
|
|
return __new__(Date);
|
|
return __new__(Date);
|
|
};
|
|
};
|
|
|
|
+ Date.fromTime = function(t){
|
|
|
|
+ var d = __new__(Date);
|
|
|
|
+ d.setTime( t );
|
|
|
|
+ return d;
|
|
|
|
+ };
|
|
Date.prototype.toString = function() {
|
|
Date.prototype.toString = function() {
|
|
var m = this.getMonth() + 1;
|
|
var m = this.getMonth() + 1;
|
|
var d = this.getDate();
|
|
var d = this.getDate();
|