From e40d151ef4ac7a064164e9a5746e2b6bc0b9c84d Mon Sep 17 00:00:00 2001 From: Mike Bostock Date: Wed, 11 Nov 2015 14:28:37 -0800 Subject: [PATCH] Clearer. --- src/locale.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/locale.js b/src/locale.js index 08b7e25..6af7a20 100644 --- a/src/locale.js +++ b/src/locale.js @@ -146,7 +146,8 @@ export default function(locale) { if (specifier.charCodeAt(i) === 37) { string.push(specifier.slice(j, i)); if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i); - if (format = formats[c]) c = format(date, pad == null ? (c === "e" ? " " : "0") : pad); + else pad = c === "e" ? " " : "0"; + if (format = formats[c]) c = format(date, pad); string.push(c); j = i + 1; }