Skip to content

Commit fbcc82b

Browse files
committed
Remove duplicate locale specification.
1 parent d6d2792 commit fbcc82b

6 files changed

Lines changed: 46 additions & 55 deletions

File tree

d3.v2.js

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6273,7 +6273,7 @@
62736273
};
62746274
}
62756275
d3.time = {};
6276-
var d3_time = Date;
6276+
var d3_time = Date, d3_time_weekdaySymbols = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ];
62776277
function d3_time_utc() {
62786278
this._ = new Date(arguments.length > 1 ? Date.UTC.apply(this, arguments) : arguments[0]);
62796279
}
@@ -6341,34 +6341,7 @@
63416341
};
63426342
var d3_time_prototype = Date.prototype;
63436343
var d3_time_formatDateTime = "%a %b %e %H:%M:%S %Y", d3_time_formatDate = "%m/%d/%y", d3_time_formatTime = "%H:%M:%S";
6344-
var d3_time_weekdays = d3_time_weekdaySymbols, d3_time_weekdayAbbrevRe = /^(?:sun|mon|tue|wed|thu|fri|sat)/i, d3_time_weekdayRe = /^(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)/i;
6345-
var d3_time_months = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ], d3_time_monthRe = /^(?:January|February|March|April|May|June|July|August|September|October|November|December)/ig, d3_time_monthAbbrevLookup = d3.map({
6346-
jan: 0,
6347-
feb: 1,
6348-
mar: 2,
6349-
apr: 3,
6350-
may: 4,
6351-
jun: 5,
6352-
jul: 6,
6353-
aug: 7,
6354-
sep: 8,
6355-
oct: 9,
6356-
nov: 10,
6357-
dec: 11
6358-
}), d3_time_monthLookup = d3.map({
6359-
january: 0,
6360-
february: 1,
6361-
march: 2,
6362-
april: 3,
6363-
may: 4,
6364-
june: 5,
6365-
july: 6,
6366-
august: 7,
6367-
september: 8,
6368-
october: 9,
6369-
november: 10,
6370-
december: 11
6371-
});
6344+
var d3_time_weekdays = d3_time_weekdaySymbols, d3_time_months = [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ];
63726345
d3.time.format = function(template) {
63736346
var n = template.length;
63746347
function format(date) {
@@ -6418,7 +6391,19 @@
64186391
}
64196392
return j;
64206393
}
6421-
var d3_time_zfill2 = d3.format("02d"), d3_time_zfill3 = d3.format("03d"), d3_time_zfill4 = d3.format("04d"), d3_time_sfill2 = d3.format("2d"), d3_time_weekdaySymbols = [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ];
6394+
function d3_time_formatAbbrev(s) {
6395+
return s.substring(0, 3);
6396+
}
6397+
function d3_time_formatRe(names) {
6398+
return new RegExp("^(?:" + names.map(d3.requote).join("|") + ")", "i");
6399+
}
6400+
function d3_time_formatLookup(names) {
6401+
var map = new d3_Map, i = -1, n = names.length;
6402+
while (++i < n) map.set(names[i].toLowerCase(), i);
6403+
return map;
6404+
}
6405+
var d3_time_zfill2 = d3.format("02d"), d3_time_zfill3 = d3.format("03d"), d3_time_zfill4 = d3.format("04d"), d3_time_sfill2 = d3.format("2d");
6406+
var d3_time_weekdayRe = d3_time_formatRe(d3_time_weekdays), d3_time_weekdayAbbrevRe = d3_time_formatRe(d3_time_weekdays.map(d3_time_formatAbbrev)), d3_time_monthRe = d3_time_formatRe(d3_time_months), d3_time_monthLookup = d3_time_formatLookup(d3_time_months), d3_time_monthAbbrevLookup = d3_time_formatLookup(d3_time_months.map(d3_time_formatAbbrev));
64226407
var d3_time_formats = {
64236408
a: function(d) {
64246409
return d3_time_weekdays[d.getDay()].substring(0, 3);

d3.v2.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/time/format-en_US.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@ var d3_time_formatDateTime = "%a %b %e %H:%M:%S %Y",
33
d3_time_formatDate = "%m/%d/%y",
44
d3_time_formatTime = "%H:%M:%S";
55

6-
// The weekday names. Abbreviations MUST be three characters.
6+
// The weekday and month names.
77
var d3_time_weekdays = d3_time_weekdaySymbols,
8-
d3_time_weekdayAbbrevRe = /^(?:sun|mon|tue|wed|thu|fri|sat)/i,
9-
d3_time_weekdayRe = /^(?:Sunday|Monday|Tuesday|Wednesday|Thursday|Friday|Saturday)/i;
10-
11-
// The month names. Abbreviations MUST be three characters.
12-
var d3_time_months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
13-
d3_time_monthRe = /^(?:January|February|March|April|May|June|July|August|September|October|November|December)/ig,
14-
d3_time_monthAbbrevLookup = d3.map({jan: 0, feb: 1, mar: 2, apr: 3, may: 4, jun: 5, jul: 6, aug: 7, sep: 8, oct: 9, nov: 10, dec: 11}),
15-
d3_time_monthLookup = d3.map({january: 0, february: 1, march: 2, april: 3, may: 4, june: 5, july: 6, august: 7, september: 8, october: 9, november: 10, december: 11});
8+
d3_time_months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];

src/time/format-fr_FR.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,6 @@ var d3_time_formatDateTime = "%a %e %b %H:%M:%S %Y",
33
d3_time_formatDate = "%d.%m.%y",
44
d3_time_formatTime = "%H:%M:%S";
55

6-
// The weekday names. Abbreviations MUST be three characters.
6+
// The weekday and month names.
77
var d3_time_weekdays = ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"],
8-
d3_time_weekdayAbbrevRe = /^(?:dim|lun|mar|mer|jeu|ven|sam)/i,
9-
d3_time_weekdayRe = /^(?:dimanche|lundi|mardi|mercredi|jeudi|vendredi|samedi)/i;
10-
11-
// The month names. Abbreviations MUST be three characters.
12-
var d3_time_months = ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre"],
13-
d3_time_monthRe = /^(?:janvier|février|mars|avril|mai|juin|juillet|août|septembre|octobre|novembre|décembre)/i,
14-
d3_time_monthAbbrevLookup = d3.map({jan: 0, fév: 1, mar: 2, avr: 3, mai: 4, jun: 5, jul: 6, aoû: 7, sep: 8, oct: 9, nov: 10, déc: 11}),
15-
d3_time_monthLookup = d3.map({janvier: 0, février: 1, mars: 2, avril: 3, mai: 4, juin: 5, juillet: 6, août: 7, septembre: 8, octobre: 9, novembre: 10, décembre: 11});
8+
d3_time_months = ["janvier", "février", "mars", "avril", "mai", "juin", "juillet", "août", "septembre", "octobre", "novembre", "décembre"];

src/time/format.js

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,30 @@ function d3_time_parse(date, template, string, j) {
6060
return j;
6161
}
6262

63+
function d3_time_formatAbbrev(s) {
64+
return s.substring(0, 3);
65+
}
66+
67+
function d3_time_formatRe(names) {
68+
return new RegExp("^(?:" + names.map(d3.requote).join("|") + ")", "i");
69+
}
70+
71+
function d3_time_formatLookup(names) {
72+
var map = new d3_Map, i = -1, n = names.length;
73+
while (++i < n) map.set(names[i].toLowerCase(), i);
74+
return map;
75+
}
76+
6377
var d3_time_zfill2 = d3.format("02d"),
6478
d3_time_zfill3 = d3.format("03d"),
6579
d3_time_zfill4 = d3.format("04d"),
66-
d3_time_sfill2 = d3.format("2d"),
67-
d3_time_weekdaySymbols = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
80+
d3_time_sfill2 = d3.format("2d");
81+
82+
var d3_time_weekdayRe = d3_time_formatRe(d3_time_weekdays),
83+
d3_time_weekdayAbbrevRe = d3_time_formatRe(d3_time_weekdays.map(d3_time_formatAbbrev)),
84+
d3_time_monthRe = d3_time_formatRe(d3_time_months),
85+
d3_time_monthLookup = d3_time_formatLookup(d3_time_months),
86+
d3_time_monthAbbrevLookup = d3_time_formatLookup(d3_time_months.map(d3_time_formatAbbrev));
6887

6988
var d3_time_formats = {
7089
a: function(d) { return d3_time_weekdays[d.getDay()].substring(0, 3); },

src/time/time.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
d3.time = {};
22

3-
var d3_time = Date;
3+
var d3_time = Date,
4+
d3_time_weekdaySymbols = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
45

56
function d3_time_utc() {
67
this._ = new Date(arguments.length > 1

0 commit comments

Comments
 (0)