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
3d664e76
Commit
3d664e76
authored
Jul 29, 2014
by
Johannes Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
little bit config refactoring, added weekview vertical
parent
db6276bc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
dateView.js
lib/dateView.js
+16
-4
No files found.
lib/dateView.js
View file @
3d664e76
...
...
@@ -266,7 +266,10 @@ function getPropperEpochSpan(now) {
function
asString
(
data
,
now
)
{
data
=
data
.
intervals
;
if
(
data
.
length
==
0
)
{
return
[
"Jetzt geöffnet"
,
"nächter Öffnungstermin unbekannt"
];
return
{
isOpen
:
false
,
asString
:
[
"Jetzt nicht geöffnet"
,
"nächter Öffnungstermin unbekannt"
]
};
}
// var mNow = moment(now);
var
open
=
false
;
...
...
@@ -280,16 +283,25 @@ function asString(data, now) {
}
if
(
open
)
{
idx
--
;
return
[
"Jetzt geöffnet"
,
"geöffnet bis "
+
moment
(
data
[
idx
][
1
]).
format
(
"LT"
)];
return
{
isOpen
:
true
,
asString
:
[
"Jetzt geöffnet"
,
"bis "
+
moment
(
data
[
idx
][
1
]).
format
(
"LT"
)]
};
}
else
{
var
retStr
=
"Jetzt nicht geöffnet"
;
if
(
idx
==
data
.
length
)
{
return
[
retStr
,
"nächter Öffnungstermin unbekannt"
];
return
{
isOpen
:
false
,
asString
:
[
retStr
,
"nächter Öffnungstermin unbekannt"
]
}
}
else
{
var
nextM
=
moment
(
data
[
idx
][
0
]);
return
[
retStr
,
"wieder geöffnet am "
+
nextM
.
format
(
"dddd"
)
+
", "
+
nextM
.
format
(
"l"
)
+
" ab "
+
nextM
.
format
(
"LT"
)];
return
{
isOpen
:
false
,
asString
:
[
retStr
,
"wieder geöffnet am "
+
nextM
.
format
(
"dddd"
)
+
", "
+
nextM
.
format
(
"l"
)
+
" ab "
+
nextM
.
format
(
"LT"
)]
};
}
}
}
...
...
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