cleanup & comments

This commit is contained in:
Sami Samhuri 2011-03-03 19:18:29 -08:00
parent 157a85e8c2
commit 7a807339ce

View file

@ -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) {