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
84607fc2
Commit
84607fc2
authored
Jun 08, 2015
by
Johannes Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed shorttext
parent
7c248af7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
7 deletions
+37
-7
dateView.js
lib/dateView.js
+6
-4
getHours.js
serverTest/getHours.js
+3
-3
test.html
test/test.html
+28
-0
No files found.
lib/dateView.js
View file @
84607fc2
...
...
@@ -143,6 +143,8 @@ function createWeekViewVerticalRaw(dataObj, now, className, offset, addDayOfWeek
var
startDate
=
new
Date
(
now
.
getFullYear
(),
now
.
getMonth
(),
now
.
getDate
()
-
offset
);
var
endDate
=
new
Date
(
now
.
getFullYear
(),
now
.
getMonth
(),
now
.
getDate
()
+
noOfDays
-
offset
);
var
oHours
=
transformData
(
dataObj
,
startDate
,
endDate
);
console
.
log
(
require
(
"util"
).
inspect
(
oHours
,
{
depth
:
null
}));
var
hasMaybe
=
hoursMaybe
(
oHours
);
var
maxItems
=
getMaxNoOfItemsPerDay
(
oHours
);
...
...
@@ -382,8 +384,8 @@ function create3MonthView(dataObj, now) {
function
getView
(
dataObj
,
now
)
{
var
content
=
'<div class="view-container">'
;
content
+=
module
.
exports
.
week
(
dataObj
,
now
);
//content += module.exports.weekView
V(dataObj, now);
content
+=
module
.
exports
.
twoWeekV
(
dataObj
,
now
);
content
+=
module
.
exports
.
week
V
(
dataObj
,
now
);
//
content += module.exports.twoWeekV(dataObj, now);
content
+=
module
.
exports
.
threeMonth
(
dataObj
,
now
);
content
+=
'</div>'
;
return
content
;
...
...
@@ -520,7 +522,7 @@ function asString(dataObj, now) {
if
(
data
.
length
==
0
)
{
return
{
isOpen
:
false
,
text
:
[
"Jetzt nicht geöffnet"
,
"
nächster Öffnungstermin un
bekannt"
],
text
:
[
"Jetzt nicht geöffnet"
,
"
weitere Öffnungszeiten nicht
bekannt"
],
status
:
"red"
};
}
...
...
@@ -572,7 +574,7 @@ function asString(dataObj, now) {
}
return
{
isOpen
:
open
,
text
:
[
firstText
,
secondText
],
text
:
[
firstText
,
secondText
]
.
join
(
", "
)
,
status
:
status
}
}
...
...
serverTest/getHours.js
View file @
84607fc2
...
...
@@ -12,9 +12,9 @@ var data = Object.keys(ohoursMap).map(function (key) {
return
obj
;
});
//
data = data.filter(function (e) {
// return e.name == "Hofladen Lang"
;
//
});
data
=
data
.
filter
(
function
(
e
)
{
return
e
.
name
.
match
(
/Preuschl Alfred/i
)
;
});
console
.
log
(
data
.
length
);
var
getData
=
module
.
exports
.
getData
=
function
(
now
,
cb
)
{
...
...
test/test.html
0 → 100644
View file @
84607fc2
<!DOCTYPE html>
<html>
<head
lang=
"en"
>
<meta
charset=
"UTF-8"
>
<title></title>
<style>
div
.week.container
{
background-color
:
lightgrey
;
width
:
500px
;
height
:
300px
;
}
table
{
border-collapse
:
collapse
;
position
:
relative
;
width
:
100%
;
height
:
100%
;
}
td
{
border
:
1px
solid
black
;
}
</style>
</head>
<body>
<div
class=
"week container"
>
</div>
</body>
</html>
\ 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