Skip to content

Commit

Permalink
Consolidate symbol definition.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Jan 10, 2014
1 parent 45502ac commit 5c6cc73
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions d3.js
Expand Up @@ -2247,7 +2247,7 @@
function d3_format_typeDefault(x) {
return x + "";
}
var d3_time = d3.time = {}, d3_date = Date, d3_time_daySymbols = [ "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday" ];
var d3_time = d3.time = {}, d3_date = Date;
function d3_date_utc() {
this._ = new Date(arguments.length > 1 ? Date.UTC.apply(this, arguments) : arguments[0]);
}
Expand Down Expand Up @@ -2400,7 +2400,7 @@
var year = d3_time.year(date);
return Math.floor((date - year - (date.getTimezoneOffset() - year.getTimezoneOffset()) * 6e4) / 864e5);
};
d3_time_daySymbols.forEach(function(day, i) {
[ "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday" ].forEach(function(day, i) {
i = 7 - i;
var interval = d3_time[day] = d3_time_interval(function(date) {
(date = d3_time.day(date)).setDate(date.getDate() - (date.getDay() + i) % 7);
Expand Down
10 changes: 5 additions & 5 deletions d3.min.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions src/time/time.js
@@ -1,6 +1,5 @@
var d3_time = d3.time = {},
d3_date = Date,
d3_time_daySymbols = ["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"];
d3_date = Date;

function d3_date_utc() {
this._ = new Date(arguments.length > 1
Expand Down
2 changes: 1 addition & 1 deletion src/time/week.js
Expand Up @@ -3,7 +3,7 @@ import "interval";
import "time";
import "year";

d3_time_daySymbols.forEach(function(day, i) {
["sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday"].forEach(function(day, i) {
i = 7 - i;

var interval = d3_time[day] = d3_time_interval(function(date) {
Expand Down

0 comments on commit 5c6cc73

Please sign in to comment.