Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
opening-hours
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
regionalkauf
opening-hours
Commits
6c7e902f
Commit
6c7e902f
authored
Jul 29, 2014
by
Johannes Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed errors in view rendering, added saturday, sunday and rows tag
parent
3d664e76
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
48 deletions
+26
-48
dateView.js
lib/dateView.js
+23
-11
todo
todo
+3
-37
No files found.
lib/dateView.js
View file @
6c7e902f
...
...
@@ -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="weekview
V-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
+=
" weekview
V
-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="weekview
V
-td-first'
+
cls
+
'">'
+
datString
[
0
]
+
'</td>'
);
column
.
push
(
'<td class="weekview
V-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="weekview
V-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="weekview
V-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="weekview
V
-tr">'
;
content
+=
'<tr class="weekview
-v
-tr">'
;
for
(
var
i
=
0
;
i
<
noOfDays
;
i
++
)
{
content
+=
columns
[
i
][
j
];
}
...
...
todo
View file @
6c7e902f
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment