// was in core
- /**
- Returns the number of milliseconds between this date and date
- @param {Date} date (optional) Defaults to now
- @return {Number} The diff in milliseconds
- @member Date getElapsed
- */
+
Date = XObject.extend(Date,
{
-
- // private
+ /**
+ * @static
+ * @private
+ */
parseFunctions : {count:0},
- // private
+ /** @private */
parseRegexes : [],
- // private
+ /** @private */
formatFunctions : {count:0},
formatCodeToRegex : function(character, currentGroup) {
switch (character) {
case "D":
- return {g:0,
- c:null,
- s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};
+ return {
+ g:0,
+ c:null,
+ s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"
+ };
case "j":
return {g:1,
c:"d = parseInt(results[" + currentGroup + "], 10);\n",
// now add functions to date..
XObject.extend(Date.prototype,
{
-
+ /**
+ Returns the number of milliseconds between this date and date
+ @param {Date} date (optional) Defaults to now
+ @return {Number} The diff in milliseconds
+ @member Date getElapsed
+ */
getElapsed : function(date) {
return Math.abs((date || new Date()).getTime()-this.getTime());
},