Commit 0127b96b authored by Johannes Bill's avatar Johannes Bill

fixed style for columncount in weekview

parent 21451d40
module.exports = function(config) {
module.exports = function (config) {
var _config = require('./config.json');
if(config) _config["mysqlConfig"] = config;
if (config) _config["mysqlConfig"] = config;
var dateArray = require('./lib/dateArray');
var dateView = require('./lib/dateView');
......@@ -9,10 +9,10 @@ module.exports = function(config) {
date = new Date(date.getFullYear(), date.getMonth(), date.getDate());
var epochSpan = [new Date(date.getFullYear(), date.getMonth(), date.getDate() - 7),
new Date(date.getFullYear(), date.getMonth(), date.getDate() + 2)];
dateArray(epochSpan).getData([incl, excl], plz, function(err, result) {
if(err) return cb(err);
dateArray(epochSpan).getData([incl, excl], plz, function (err, result) {
if (err) return cb(err);
result = result.intervals;
var fResult = result.filter(function(elem) {
var fResult = result.filter(function (elem) {
return elem[0].getTime() >= date.getTime();
});
......
......@@ -58,6 +58,7 @@ function wrapper(_epochSpan) {
try {
var ret = {holidays: holidays};
ret.intervals = buildOpeningHours([json.incl, json.excl], holidayIntervals);
ret.maybeIntervals = [];
if(json.maybe) {
var maybeIntervals = buildOpeningHours([json.maybe], holidayIntervals);
ret.maybeIntervals = tmUtils.andNotOp(maybeIntervals, ret.intervals);
......
......@@ -508,8 +508,10 @@ function getPropperEpochSpan(now) {
return [epochStart, epochEnd];
}
function asString(data, now) {
data = data.intervals;
function asString(dataObj, now) {
var data = dataObj.intervals;
var dataMaybe = dataObj.maybeIntervals;
if (data.length == 0) {
return {
isOpen: false,
......
......@@ -28,7 +28,8 @@ dateArray = dateArray(dateSpan);
var extractionDate = moment().format('YYYYMMDD');
//var ids = [2650, 2422, 3];
var ids = [2422, 1627, 2650, 864];
//var ids = [2422, 1627, 2650, 864];
var ids = [468];
connection.query('SELECT id, name, elements, type FROM cms_zoo_item WHERE id in ('+ ids.join(', ')+')', function (err, rows) {
for (var i = 0; i < rows.length; i++) {
var id = rows[i].id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment