admin: secondary formating

This commit is contained in:
nemunaire 2018-12-08 03:35:52 +01:00
parent 4de0c64672
commit 85658bb3c6
4 changed files with 6 additions and 6 deletions

View file

@ -1563,7 +1563,7 @@ function presenceCal(scope, location, data) {
.range(d3.range(8).map(function(d) { return "q" + d + "-8"; }));
var svg = d3.select(location).selectAll("svg")
.data(d3.range(scope.time.start, scope.time.start + (scope.time.start % 86400000 + scope.time.duration), 86400000).map(function(t) { return new Date(t); }))
.data(d3.range(scope.settings.start, scope.time.start + (scope.settings.start % 86400000 + scope.settings.end - scope.settings.start), 86400000).map(function(t) { return new Date(t); }))
.enter().append("svg")
.attr("width", width)
.attr("height", height)
@ -1582,7 +1582,7 @@ function presenceCal(scope, location, data) {
.attr("width", cellSize)
.attr("height", cellSize)
.attr("transform", function(d) { return "translate(" + (d.getHours() * cellSize) + "," + (d.getMinutes() / 15 * cellSize) + ")"; })
.attr("class", function(d) { if (d >= scope.time.start && d < scope.time.start + scope.time.duration) return color(data.reduce(function(prev, cur){
.attr("class", function(d) { if (d >= scope.settings.start && d < scope.settings.start + scope.settings.end - scope.settings.start) return color(data.reduce(function(prev, cur){
cur = new Date(cur).getTime();
dv = d.getTime();
return prev + ((dv <= cur && cur < dv+15*60000)?1:0);