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
b9aa8880
Commit
b9aa8880
authored
Jan 29, 2015
by
Johannes Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed issue with hours over midnight
parent
cf1da512
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
4 deletions
+8
-4
index.js
index.js
+2
-1
dateArray.js
lib/dateArray.js
+4
-1
dateView.js
lib/dateView.js
+1
-1
dataBaseQuery.js
serverTest/dataBaseQuery.js
+1
-1
No files found.
index.js
View file @
b9aa8880
...
...
@@ -28,7 +28,8 @@ module.exports = function (config) {
}),
maybeToday
:
resultMaybe
.
filter
(
function
(
elem
)
{
return
elem
[
0
].
getTime
()
>=
today
.
getTime
()
&&
elem
[
1
].
getTime
()
<=
tomorrow
.
getTime
();
})
}),
debugInfo
:
result
.
debugInfo
};
cb
(
null
,
fResult
);
...
...
lib/dateArray.js
View file @
b9aa8880
...
...
@@ -7,6 +7,8 @@ var excludeString = "bb74c170-b06f-4d2b-ab88-2f6bf9ce8068";
var
maybeIncludeString
=
"e85aacb0-bd79-4091-a271-85de0cebf66d"
;
function
wrapper
(
_epochSpan
)
{
var
debugInfo
=
''
;
var
epochSpan
;
var
year
;
var
startYear
;
...
...
@@ -63,6 +65,7 @@ function wrapper(_epochSpan) {
var
maybeIntervals
=
buildOpeningHours
([
json
.
maybe
],
holidayIntervals
);
ret
.
maybeIntervals
=
tmUtils
.
andNotOp
(
maybeIntervals
,
ret
.
intervals
);
}
ret
.
debugInfo
=
debugInfo
;
cb
(
null
,
ret
);
}
...
...
@@ -225,7 +228,7 @@ function wrapper(_epochSpan) {
var
startDate
,
endDate
;
if
(
!
end
)
{
console
.
log
(
'no endDate for dateSpan'
)
;
debugInfo
+=
'no endDate for dateSpan'
;
startDate
=
new
Date
(
startYear
,
start
[
1
]
-
1
,
start
[
0
]);
endDate
=
new
Date
(
startYear
+
2
,
start
[
1
]
-
1
,
start
[
0
]);
return
[[
startDate
,
endDate
]];
...
...
lib/dateView.js
View file @
b9aa8880
...
...
@@ -512,7 +512,7 @@ function compareDate(date1, date2) {
function
getPropperEpochSpan
(
now
)
{
var
epochStart
=
new
Date
(
now
.
getFullYear
(),
now
.
getMonth
(),
-
10
);
var
epochEnd
=
new
Date
(
now
.
getFullYear
(),
now
.
getMonth
()
+
3
,
1
);
var
epochEnd
=
new
Date
(
now
.
getFullYear
(),
now
.
getMonth
()
+
3
,
2
);
return
[
epochStart
,
epochEnd
];
}
...
...
serverTest/dataBaseQuery.js
View file @
b9aa8880
...
...
@@ -20,7 +20,7 @@ module.exports.getData = function (now, cb) {
// dateArray.setEpocheSpan(epocheSpan);
// connection.query('SELECT name, elements FROM cms_zoo_item WHERE type in ("pos", "company") ORDER BY id', function (err, rows) {
connection
.
query
(
'SELECT name, type, elements FROM cms_zoo_item WHERE id in (
4116
)'
,
function
(
err
,
rows
)
{
connection
.
query
(
'SELECT name, type, elements FROM cms_zoo_item WHERE id in (
1793
)'
,
function
(
err
,
rows
)
{
console
.
error
(
err
);
console
.
log
(
rows
.
length
);
var
result
=
[];
...
...
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