| 7977 | d3.time.format = function(template) { |
| 7978 | var n = template.length; |
| 7979 | function format(date) { |
| 7980 | var string = [], i = -1, j = 0, c, p, f; |
| 7981 | while (++i < n) { |
| 7982 | if (template.charCodeAt(i) === 37) { |
| 7983 | string.push(template.substring(j, i)); |
| 7984 | if ((p = d3_time_formatPads[c = template.charAt(++i)]) != null) c = template.charAt(++i); |
| 7985 | if (f = d3_time_formats[c]) c = f(date, p == null ? c === "e" ? " " : "0" : p); |
| 7986 | string.push(c); |
| 7987 | j = i + 1; |
| 7988 | } |
| 7989 | } |
| 7990 | string.push(template.substring(j, i)); |
| 7991 | return string.join(""); |
| 7992 | } |
| 7993 | format.parse = function(string) { |
| 7994 | var d = { |
| 7995 | y: 1900, |