Skip to content

Commit

Permalink
Renamed some identifiers to keep them in line with the new approach.
Browse files Browse the repository at this point in the history
  • Loading branch information
kbaltrinic committed Dec 11, 2013
1 parent 960adf4 commit fafa428
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions phantomjs_dateparse_polyfill.js
Expand Up @@ -30,36 +30,36 @@

Date = (function (JSDate) {

function newDate() {
var theDate;
function dateCtorDecorator() {
var newDate;
if (arguments.length === 1 && typeof arguments[0] === "string") {
theDate = new JSDate(fixStringDate(arguments[0]))
newDate = new JSDate(fixStringDate(arguments[0]))
} else {
//Can't get apply to work against JSDate's constructor.
//It always returns the current date and time. :-(
if (arguments.length == 1)
theDate = new JSDate(arguments[0]);
newDate = new JSDate(arguments[0]);
else if (arguments.length == 2)
theDate = new JSDate(arguments[0], arguments[1]);
newDate = new JSDate(arguments[0], arguments[1]);
else if (arguments.length == 3)
theDate = new JSDate(arguments[0], arguments[1], arguments[2]);
newDate = new JSDate(arguments[0], arguments[1], arguments[2]);
else if (arguments.length == 4)
theDate = new JSDate(arguments[0], arguments[1], arguments[2], arguments[3]);
newDate = new JSDate(arguments[0], arguments[1], arguments[2], arguments[3]);
else if (arguments.length == 5)
theDate = new JSDate(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]);
newDate = new JSDate(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4]);
else if (arguments.length == 6)
theDate = new JSDate(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
newDate = new JSDate(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]);
else if (arguments.length == 7)
theDate = new JSDate(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6]);
newDate = new JSDate(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6]);
}
return theDate;
return newDate;
}

newDate.parse = function (sDate) {
dateCtorDecorator.parse = function (sDate) {
return JSDate.parse(fixStringDate(sDate));
}

return newDate;
return dateCtorDecorator;

})(Date)

Expand Down

0 comments on commit fafa428

Please sign in to comment.