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

View file

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