App-Dochazka-WWW
view release on metacpan or search on metacpan
share/js/dochazka-www/svg-lib.js view on Meta::CPAN
var
absWidth = 870,
dayViewerIntervals = function (date, obj, how) {
// returns an SVG document for date, reflecting clocked and
// scheduled intervals in obj; how is a boolean value "holiday or
// weekend"
var r = '',
fill, i, intvl, begin, bo, end, eo, color;
if (how) {
fill = 'font-weight="bold" fill="transparent"';
} else {
fill = 'fill="black"';
}
r += '<svg width="' + absWidth + '" height="30" ' + svgBoilerPlate + '>';
// draw base rectangle
r += '<rect x="5" y="0" width="' + absWidth + '" height="30" fill="gray" stroke="transparent"/>';
// draw attendance intervals
for (i = 0; i < obj.clocked.length; i += 1) {
intvl = obj.clocked[i];
[begin, end] = intvl.iNtimerange.split('-');
( run in 1.276 second using v1.01-cache-2.11-cpan-5735350b133 )