fix order of args in recursive calls

This commit is contained in:
Sami Samhuri 2010-11-11 13:31:09 -08:00
parent caec43bebd
commit abc8331a9c
2 changed files with 7 additions and 7 deletions

View file

@ -39,10 +39,10 @@ var strftime = (function() {
case 'B': return Months[d.getMonth()];
case 'b': // fall through
case 'h': return MonthsShort[d.getMonth()];
case 'D': return strftime(d, '%m/%d/%y');
case 'D': return strftime('%m/%d/%y', d);
case 'd': return pad(d.getDate());
case 'e': return d.getDate();
case 'F': return strftime(d, '%Y-%m-%d');
case 'F': return strftime('%Y-%m-%d', d);
case 'H': return pad(d.getHours());
case 'I': return pad(hours12(d));
case 'k': return pad(d.getHours(), ' ');
@ -51,16 +51,16 @@ var strftime = (function() {
case 'm': return pad(d.getMonth() + 1);
case 'n': return '\n';
case 'p': return d.getHours() < 12 ? 'AM' : 'PM';
case 'R': return strftime(d, '%H:%M');
case 'r': return strftime(d, '%I:%M:%S %p');
case 'R': return strftime('%H:%M', d);
case 'r': return strftime('%I:%M:%S %p', d);
case 'S': return pad(d.getSeconds());
case 's': return d.getTime();
case 'T': return strftime(d, '%H:%M:%S');
case 'T': return strftime('%H:%M:%S', d);
case 't': return '\t';
case 'u':
var day = d.getDay();
return day == 0 ? 7 : day; // 1 - 7, Monday is first day of the week
case 'v': return strftime(d, '%e-%b-%Y');
case 'v': return strftime('%e-%b-%Y', d);
case 'w': return d.getDay(); // 0 - 6, Sunday is first day of the week
case 'Y': return d.getFullYear();
case 'y':

View file

@ -1,6 +1,6 @@
{ "name" : "strftime"
, "description" : "strftime for JavaScript"
, "version" : "0.2.0"
, "version" : "0.2.1"
, "homepage" : "http://samhuri.net/node/strftime"
, "author" : "Sami Samhuri <sami.samhuri@gmail.com>"
, "repository" :