Merge branch 'fix-time-format-bc-year' into 3.2
This commit is contained in:
Коммит
cffb119746
|
@ -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 = {
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
|
@ -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");
|
||||
|
|
Загрузка…
Ссылка в новой задаче