Merge branch 'fix-time-format-bc-year' into 3.2

This commit is contained in:
Mike Bostock 2013-05-30 11:26:14 -07:00
Родитель 7e1174f4da 8dce4f0b88
Коммит cffb119746
4 изменённых файлов: 10 добавлений и 8 удалений

5
d3.js поставляемый
Просмотреть файл

@ -8207,9 +8207,8 @@ d3 = function() {
return map;
}
function d3_time_formatPad(value, fill, width) {
value += "";
var length = value.length;
return length < width ? new Array(width - length + 1).join(fill) + value : value;
var sign = value < 0 ? "-" : "", string = (sign ? -value : value) + "", length = string.length;
return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);
}
var d3_time_dayRe = d3_time_formatRe(d3_time_days), d3_time_dayAbbrevRe = d3_time_formatRe(d3_time_dayAbbreviations), d3_time_monthRe = d3_time_formatRe(d3_time_months), d3_time_monthLookup = d3_time_formatLookup(d3_time_months), d3_time_monthAbbrevRe = d3_time_formatRe(d3_time_monthAbbreviations), d3_time_monthAbbrevLookup = d3_time_formatLookup(d3_time_monthAbbreviations);
var d3_time_formatPads = {

4
d3.min.js поставляемый

Различия файлов скрыты, потому что одна или несколько строк слишком длинны

Просмотреть файл

@ -79,9 +79,10 @@ function d3_time_formatLookup(names) {
}
function d3_time_formatPad(value, fill, width) {
value += "";
var length = value.length;
return length < width ? new Array(width - length + 1).join(fill) + value : value;
var sign = value < 0 ? "-" : "",
string = (sign ? -value : value) + "",
length = string.length;
return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);
}
var d3_time_dayRe = d3_time_formatRe(d3_time_days),

Просмотреть файл

@ -142,6 +142,7 @@ suite.addBatch({
var f = format("%y");
assert.equal(f(local(1990, 0, 1)), "90");
assert.equal(f(local(2002, 0, 1)), "02");
assert.equal(f(local(-2, 0, 1)), "-02");
},
"formats zero-padded four-digit year": function(format) {
var f = format("%Y");
@ -149,6 +150,7 @@ suite.addBatch({
assert.equal(f(local(1990, 0, 1)), "1990");
assert.equal(f(local(2002, 0, 1)), "2002");
assert.equal(f(local(10002, 0, 1)), "0002");
assert.equal(f(local(-2, 0, 1)), "-0002");
},
"formats time zone": function(format) {
var f = format("%Z");