Commit 6c7e902f authored by Johannes Bill's avatar Johannes Bill

fixed errors in view rendering, added saturday, sunday and rows tag

parent 3d664e76
......@@ -13,7 +13,7 @@ function createWeekView(dataObj, now) {
var maxNumber = getMaxNoOfItemsPerDay(oHours);
var tableWidth = maxNumber;
var content = '<div class="weekview-container"><table class="weekview-table">';
var content = '<div class="weekview-container"><table class="weekview-table weekview-' + (tableWidth + 2) + 'col">';
content += '<tbody>';
for (var i = 0; i < noOfDays; i++) {
......@@ -28,12 +28,18 @@ function createWeekView(dataObj, now) {
if (compareDate(day.date, now) == 0) {
cls += " weekview-today";
}
if(day.date.getDay() == 0) {
cls += " weekview-sunday";
}
else if(day.date.getDay() == 6) {
cls += " weekview-saturday";
}
content += '<td class="weekview-td-first' + cls + '">' + datString[0] + '</td><td class="weekview-td-first' + cls + '">' + datString[1] + '</td>';
content += '<td class="weekview-td' + cls + '">' + datString[0] + '</td><td class="weekview-td' + cls + '">' + datString[1] + '</td>';
for (var j = 0; j < day.oHours.length; j++) {
var oHour = day.oHours[j];
content += '<td class="weekview-td weekview-filled' + cls + '">' + formatTime(oHour[0]) + "" + formatTime(oHour[1]) + '</td>';
content += '<td class="weekview-td weekview-filled' + cls + '">' + formatTime(oHour[0]) + "" + formatTime(oHour[1]) + '</td>';
}
for (var j = day.oHours.length; j < tableWidth; j++) {
content += '<td class="weekview-td weekview-empty' + cls + '"></td>';
......@@ -57,7 +63,7 @@ function createWeekViewVertical(dataObj, now) {
var maxNumber = getMaxNoOfItemsPerDay(oHours);
var tableWidth = maxNumber;
var content = '<div class="weekviewV-container"><table class="weekviewV-table">';
var content = '<div class="weekview-v-container"><table class="weekview-v-table">';
content += '<tbody>';
var columns = [];
......@@ -69,27 +75,33 @@ function createWeekViewVertical(dataObj, now) {
var cls = '';
if (dayInHolidays(day.date, holidays)) {
cls += " weekviewV-holiday";
cls += " weekview-v-holiday";
}
if (compareDate(day.date, now) == 0) {
cls += " weekviewV-today";
cls += " weekview-v-today";
}
if(day.date.getDay() == 0) {
cls += " weekview-v-sunday";
}
else if(day.date.getDay() == 6) {
cls += " weekview-v-saturday";
}
var datString = formatDate(day.date);
column.push('<td class="weekviewV-td-first' + cls + '">' + datString[0] + '</td>');
column.push('<td class="weekviewV-td-first' + cls + '">' + datString[1] + '</td>');
column.push('<td class="weekview-v-td-first' + cls + '">' + datString[0] + '</td>');
column.push('<td class="weekview-v-td-date' + cls + '">' + datString[1] + '</td>');
for (var j = 0; j < day.oHours.length; j++) {
var oHour = day.oHours[j];
column.push('<td class="weekviewV-td weekviewV-filled' + cls + '">' + formatTime(oHour[0]) + "–" + formatTime(oHour[1]) + '</td>');
column.push('<td class="weekview-v-td weekview-v-filled' + cls + '">' + formatTime(oHour[0]) + " – " + formatTime(oHour[1]) + '</td>');
}
for (var j = day.oHours.length; j < tableWidth; j++) {
column.push('<td class="weekviewV-td weekviewV-empty' + cls + '"></td>');
column.push('<td class="weekview-v-td weekview-v-empty' + cls + '"></td>');
}
}
for (var j = 0; j < tableWidth + 2; j++) {
content += '<tr class="weekviewV-tr">';
content += '<tr class="weekview-v-tr">';
for (var i = 0; i < noOfDays; i++) {
content += columns[i][j];
}
......
verbindung feiertag - region
ics import - regeln extrahieren
was passiert bei der zeitumstellung?
......@@ -8,42 +6,10 @@ falls oeffnungszeit z.b. von 21:00 bis 4:00 muss bei 0:00 getrennt werden
saisonal,urlaub etc ueber neujahr? 23.12.2014 - 10.01.2015????
Funktionen:
openNow(json, now, plz, lang, asString)
asString
Falls geoffnet:
<WochenTag>, jetzt bis <UhrZeit> geoeffnet.
Falls nicht geoffnet:
Am <WochenTag> nicht geoffnet. Wieder geoeffnet am <WochendTag, Datum> ab <UhrZeit>.
asLiteral
{
open: true|false,
date: bis|ab
}
asIndexJson
0 { opening-from:
opening-to:
opening-day:}
1 { .... }
...
asIndex
Array(day => ""
open => ""
close => "")
openingHoursView(json, now, regionalCode, lang)
-->html string
openNow auch nach absprache, nur mit json incl
evtl ical export
!!!!holiday klasse, falls feiertag, klasse fuer aktuellen tag
\ No newline at end of file
saturday, sunday class in weekview
weekview-3col
\ No newline at end of file
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