From abc8331a9cd1a3d2be0cfab0fa62243ab22f59b4 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Thu, 11 Nov 2010 13:31:09 -0800 Subject: [PATCH] fix order of args in recursive calls --- lib/index.js | 12 ++++++------ package.json | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/index.js b/lib/index.js index be93770..05f6f45 100644 --- a/lib/index.js +++ b/lib/index.js @@ -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': diff --git a/package.json b/package.json index 7515f76..95be79f 100644 --- a/package.json +++ b/package.json @@ -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 " , "repository" :