* Fork - LGPL
* <script type="text/javascript">
*/
+// usage: Date= imports.Date.Date;
-//imports['Date.js'].load(Date);
-if (imports) {
- imports['String.js'].load(String);
-}
-
-if (imports) {
- load = false; // declare global for gnome langs.
-}
-(function() {
-
+String = imports.String.String;
+XObject = imports.XObject.XObject;
/**
@return {Number} The diff in milliseconds
@member Date getElapsed
*/
- var date = {
+Date = XObject.extend(Date,
+ {
// private
parseFunctions : {count:0},
}
- };
+
+}); // end static date..
- var datePrototype = {
+// now add functions to date..
+XObject.extend(Date.prototype,
+ {
getElapsed : function(date) {
return Math.abs((date || new Date()).getTime()-this.getTime());
}
return d;
}
- };
- if (imports) {
- load = function(ar) {
- Date = ar;
- imports.lang.copyPropertiesNoOverwrite( date,ar);
- imports.lang.copyPropertiesNoOverwrite(datePrototype, ar.prototype);
-
- };
- } else {
- // non imports version.
- for(i in datePrototype) {
- if (!Date.prototype[i]) {
- Date.prototype[i] = datePrototype[i];
- }
- }
- for(i in date) {
- if (!Date[i]) {
- Date[i] = date[i];
- }
- }
- }
-})();
\ No newline at end of file
+
+});
\ No newline at end of file