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
0127b96b
Commit
0127b96b
authored
Sep 11, 2014
by
Johannes Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed style for columncount in weekview
parent
21451d40
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
8 deletions
+12
-8
index.js
index.js
+5
-5
dateArray.js
lib/dateArray.js
+1
-0
dateView.js
lib/dateView.js
+4
-2
extractTestData.js
test/extractTestData.js
+2
-1
No files found.
index.js
View file @
0127b96b
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
();
});
...
...
lib/dateArray.js
View file @
0127b96b
...
...
@@ -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
);
...
...
lib/dateView.js
View file @
0127b96b
...
...
@@ -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
,
...
...
test/extractTestData.js
View file @
0127b96b
...
...
@@ -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
;
...
...
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