diff --git a/lib/index.js b/lib/index.js index 48b5f9c..1364cd8 100644 --- a/lib/index.js +++ b/lib/index.js @@ -32,17 +32,15 @@ return hour; } - // loc is a function that maps the default English names to localized - // names. In most cases it will just look up strings in a map but it's - // a function for added flexibility. + // locale is an object with the same structure as DefaultLocale function strftime(fmt, d, locale) { - // d and loc are optional, check if d is really loc + // d and locale are optional so check if d is really the locale if (d && !(d instanceof Date)) { locale = d; - d = new Date(); + d = undefined; } - locale = locale || DefaultLocale; d = d || new Date(); + locale = locale || DefaultLocale; // Most of the specifiers supported by C's strftime return fmt.replace(/%(.)/g, function(_, c) {