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
2704d42b
Commit
2704d42b
authored
Jun 25, 2014
by
Johannes Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parse json
parent
ff194ce6
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
997 additions
and
176 deletions
+997
-176
data.json
data.json
+0
-164
jsonInput.js
jsonInput.js
+91
-0
test.js
test.js
+8
-8
data.json
testData/data.json
+314
-0
testHof.json
testData/testHof.json
+571
-0
timeUtils.js
timeUtils.js
+10
-3
todo
todo
+3
-1
No files found.
data.json
deleted
100644 → 0
View file @
ff194ce6
{
"0"
:
{
"option"
:
{
"0"
:
"default"
},
"dayoption"
:
{
"0"
:
"1"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
""
,
"opening_day_to"
:
""
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"18:00"
},
"1"
:
{
"option"
:
{
"0"
:
"default"
},
"dayoption"
:
{
"0"
:
"2"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
""
,
"opening_day_to"
:
""
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"12:00"
},
"2"
:
{
"option"
:
{
"0"
:
"default"
},
"dayoption"
:
{
"0"
:
"2"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
""
,
"opening_day_to"
:
""
,
"opening_from"
:
"13:00"
,
"opening_to"
:
"18:00"
},
"3"
:
{
"option"
:
{
"0"
:
"default"
},
"dayoption"
:
{
"0"
:
"8"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
""
,
"opening_day_to"
:
""
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"18:00"
},
"4"
:
{
"option"
:
{
"0"
:
"repeatable"
},
"dayoption"
:
{
"0"
:
"3"
},
"repeatoption"
:
{
"0"
:
"3"
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
""
,
"opening_day_to"
:
""
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"18:00"
},
"5"
:
{
"option"
:
{
"0"
:
"repeatable"
},
"dayoption"
:
{
"0"
:
"4"
},
"repeatoption"
:
{
"0"
:
"14"
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
"02.01"
,
"opening_day_to"
:
""
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"18:00"
},
"6"
:
{
"option"
:
{
"0"
:
"season"
},
"dayoption"
:
{
"0"
:
"5"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
"25.05"
,
"opening_day_to"
:
"30.11"
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"18:00"
},
"7"
:
{
"option"
:
{
"0"
:
"holiday"
},
"dayoption"
:
{
"0"
:
"1"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
"0"
},
"opening_day_from"
:
""
,
"opening_day_to"
:
""
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"18:00"
},
"8"
:
{
"option"
:
{
"0"
:
"vacation"
},
"dayoption"
:
{
"0"
:
"1"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
"25.08"
,
"opening_day_to"
:
"10.09"
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"18:00"
}
}
\ No newline at end of file
jsonInput.js
0 → 100644
View file @
2704d42b
var
tmUtils
=
require
(
'./timeUtils'
);
var
now
=
new
Date
();
var
_epochStart
=
new
Date
();
_epochStart
.
setDate
(
_epochStart
.
getDate
()
-
14
);
var
_epochEnd
=
new
Date
(
_epochStart
.
getTime
()
+
60
*
24
*
3600000
);
function
calculateOpeningHours
(
json
)
{
var
jsonIncl
=
json
[
"include"
];
for
(
var
key
in
jsonIncl
)
{
var
dateA
=
getOpeningHours
(
jsonIncl
[
key
]);
console
.
log
(
key
,
dateA
);
}
}
function
getDaySpan
(
dayoption
)
{
if
(
dayoption
<
7
)
return
[
dayoption
,
dayoption
];
switch
(
dayoption
)
{
case
7
:
return
[
0
,
0
];
case
8
:
return
[
0
,
7
];
case
9
:
return
[
1
,
5
];
case
10
:
return
[
1
,
6
];
default
:
throw
"Invalid day option"
;
}
}
function
parseTime
(
time
)
{
var
split
=
time
.
split
(
":"
);
return
{
h
:
parseInt
(
split
[
0
]),
m
:
parseInt
(
split
[
1
])
}
}
function
parseDate
(
date
)
{
if
(
date
.
length
==
0
)
return
null
;
var
year
=
now
.
getFullYear
();
var
split
=
date
.
split
(
"."
);
var
month
=
parseInt
(
split
[
1
]);
var
day
=
parseInt
(
split
[
0
]);
return
new
Date
(
year
,
month
,
day
);
}
function
getOpeningHours
(
json
)
{
var
dayoption
=
parseInt
(
json
[
"dayoption"
][
"0"
]);
var
daySpan
=
getDaySpan
(
dayoption
);
var
option
=
json
[
"option"
][
"0"
];
var
startDate
=
parseDate
(
json
[
"opening_day_from"
])
||
_epochStart
;
var
endDate
=
parseDate
(
json
[
"opening_day_to"
])
||
_epochEnd
;
var
timeFrom
=
parseTime
(
json
[
"opening_from"
]);
var
timeTill
=
parseTime
(
json
[
"opening_to"
]);
switch
(
option
)
{
case
"default"
:
return
tmUtils
.
standardFromTillDay
(
daySpan
[
0
],
daySpan
[
1
],
timeFrom
,
timeTill
,
_epochStart
,
_epochEnd
,
7
);
case
"season"
:
return
tmUtils
.
standardFromTillDay
(
daySpan
[
0
],
daySpan
[
1
],
timeFrom
,
timeTill
,
startDate
,
endDate
,
7
);
case
"repeatable"
:
var
repeatOption
=
parseInt
(
json
[
"repeatoption"
][
"0"
]);
var
noInMonth
;
if
(
repeatOption
<=
4
)
noInMonth
=
repeatOption
;
else
if
(
repeatOption
==
30
)
noInMonth
=
-
1
;
if
(
noInMonth
)
return
tmUtils
.
cyclicFromTillDay
(
daySpan
[
0
],
daySpan
[
1
],
noInMonth
,
timeFrom
,
timeTill
,
startDate
,
endDate
);
switch
(
repeatOption
)
{
case
14
:
case
21
:
case
28
:
return
tmUtils
.
standardFromTillDay
(
daySpan
[
0
],
daySpan
[
1
],
timeFrom
,
timeTill
,
startDate
,
endDate
,
repeatOption
);
default
:
throw
"invalid repeat option"
;
}
}
}
calculateOpeningHours
(
require
(
'./testData/data.json'
));
\ No newline at end of file
test.js
View file @
2704d42b
var
u
tils
=
require
(
'./timeUtils'
);
var
tmU
tils
=
require
(
'./timeUtils'
);
//gibt zu betrachtenden Zeitraum an.
var
_epochStart
=
new
Date
(
2014
,
5
,
24
,
0
);
...
...
@@ -17,16 +17,16 @@ console.log("epochEnd ", _epochEnd);
//console.log(workday);
var
t1
=
u
tils
.
cyclicFromTillDay
(
1
,
1
,
1
,
{
h
:
9
,
m
:
0
},
{
h
:
0
,
m
:
0
},
_epochStart
,
_epochEnd
);
var
t2
=
u
tils
.
cyclicFromTillDay
(
2
,
2
,
1
,
{
h
:
0
,
m
:
0
},
{
h
:
18
,
m
:
29
},
_epochStart
,
_epochEnd
);
var
t1
=
tmU
tils
.
cyclicFromTillDay
(
1
,
1
,
1
,
{
h
:
9
,
m
:
0
},
{
h
:
0
,
m
:
0
},
_epochStart
,
_epochEnd
);
var
t2
=
tmU
tils
.
cyclicFromTillDay
(
2
,
2
,
1
,
{
h
:
0
,
m
:
0
},
{
h
:
18
,
m
:
29
},
_epochStart
,
_epochEnd
);
t1
=
u
tils
.
standardFromTillDay
(
3
,
3
,
{
h
:
21
,
m
:
0
},
{
h
:
0
,
m
:
0
},
_epochStart
,
_epochEnd
,
7
);
t2
=
u
tils
.
standardFromTillDay
(
4
,
4
,
{
h
:
0
,
m
:
0
},
{
h
:
18
,
m
:
0
},
_epochStart
,
_epochEnd
,
7
);
t1
=
tmU
tils
.
standardFromTillDay
(
3
,
3
,
{
h
:
21
,
m
:
0
},
{
h
:
0
,
m
:
0
},
_epochStart
,
_epochEnd
,
7
);
t2
=
tmU
tils
.
standardFromTillDay
(
4
,
4
,
{
h
:
0
,
m
:
0
},
{
h
:
18
,
m
:
0
},
_epochStart
,
_epochEnd
,
7
);
console
.
log
(
t1
);
console
.
log
(
t2
);
var
t
=
utils
.
orOperator
([
t1
,
t2
]);
var
t
=
tmUtils
.
orOperator
([
t1
,
t2
,
tmUtils
.
singleDay
(
new
Date
())
]);
console
.
log
(
t
);
console
.
log
(
utils
.
mergeOverlaps
(
t
));
//console.log(utils.orOperator([t,t2]));
\ No newline at end of file
console
.
log
(
tmUtils
.
mergeOverlaps
(
t
));
//console.log(tmUtils.orOperator([t,t2]));
\ No newline at end of file
testData/data.json
0 → 100644
View file @
2704d42b
{
"include"
:
{
"0"
:
{
"option"
:
{
"0"
:
"default"
},
"dayoption"
:
{
"0"
:
"1"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
""
,
"opening_day_to"
:
""
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"18:00"
},
"1"
:
{
"option"
:
{
"0"
:
"default"
},
"dayoption"
:
{
"0"
:
"2"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
""
,
"opening_day_to"
:
""
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"12:00"
},
"2"
:
{
"option"
:
{
"0"
:
"default"
},
"dayoption"
:
{
"0"
:
"2"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
""
,
"opening_day_to"
:
""
,
"opening_from"
:
"13:00"
,
"opening_to"
:
"18:00"
},
"3"
:
{
"option"
:
{
"0"
:
"default"
},
"dayoption"
:
{
"0"
:
"8"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
""
,
"opening_day_to"
:
""
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"18:00"
},
"4"
:
{
"option"
:
{
"0"
:
"repeatable"
},
"dayoption"
:
{
"0"
:
"3"
},
"repeatoption"
:
{
"0"
:
"3"
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
""
,
"opening_day_to"
:
""
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"18:00"
},
"5"
:
{
"option"
:
{
"0"
:
"repeatable"
},
"dayoption"
:
{
"0"
:
"4"
},
"repeatoption"
:
{
"0"
:
"14"
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
"02.01"
,
"opening_day_to"
:
""
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"18:00"
},
"6"
:
{
"option"
:
{
"0"
:
"season"
},
"dayoption"
:
{
"0"
:
"5"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
"25.05"
,
"opening_day_to"
:
"30.11"
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"18:00"
},
"7"
:
{
"option"
:
{
"0"
:
"holiday"
},
"dayoption"
:
{
"0"
:
"1"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
"0"
},
"opening_day_from"
:
""
,
"opening_day_to"
:
""
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"18:00"
},
"8"
:
{
"option"
:
{
"0"
:
"vacation"
},
"dayoption"
:
{
"0"
:
"1"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
"25.08"
,
"opening_day_to"
:
"10.09"
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"18:00"
}
},
"exclude"
:
{
"0"
:
{
"option"
:
{
"0"
:
"default"
},
"dayoption"
:
{
"0"
:
"0"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
"01.01"
,
"opening_day_to"
:
""
,
"opening_from"
:
""
,
"opening_to"
:
""
},
"1"
:
{
"option"
:
{
"0"
:
"repeatable"
},
"dayoption"
:
{
"0"
:
"1"
},
"repeatoption"
:
{
"0"
:
"3"
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
"01.01"
,
"opening_day_to"
:
""
,
"opening_from"
:
""
,
"opening_to"
:
""
},
"2"
:
{
"option"
:
{
"0"
:
"season"
},
"dayoption"
:
{
"0"
:
"8"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
"01.01"
,
"opening_day_to"
:
"01.02"
,
"opening_from"
:
""
,
"opening_to"
:
""
},
"3"
:
{
"option"
:
{
"0"
:
"holiday"
},
"dayoption"
:
{
"0"
:
"0"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
"121"
},
"opening_day_from"
:
"01.01"
,
"opening_day_to"
:
""
,
"opening_from"
:
""
,
"opening_to"
:
""
},
"4"
:
{
"option"
:
{
"0"
:
"holiday"
},
"dayoption"
:
{
"0"
:
"0"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
"122"
},
"opening_day_from"
:
"01.01"
,
"opening_day_to"
:
""
,
"opening_from"
:
""
,
"opening_to"
:
""
},
"5"
:
{
"option"
:
{
"0"
:
"holiday"
},
"dayoption"
:
{
"0"
:
"0"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
"123"
},
"opening_day_from"
:
"01.01"
,
"opening_day_to"
:
""
,
"opening_from"
:
""
,
"opening_to"
:
""
},
"6"
:
{
"option"
:
{
"0"
:
"default"
},
"dayoption"
:
{
"0"
:
"0"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
"01.01"
,
"opening_day_to"
:
""
,
"opening_from"
:
""
,
"opening_to"
:
""
},
"7"
:
{
"option"
:
{
"0"
:
"vacation"
},
"dayoption"
:
{
"0"
:
"0"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
"01.10"
,
"opening_day_to"
:
"09.10"
,
"opening_from"
:
""
,
"opening_to"
:
""
}
}
}
testData/testHof.json
0 → 100644
View file @
2704d42b
{
"f86608fb-16aa-4c70-9d57-0b5cac1a9618"
:
{
},
"4ae7b6cb-07e8-4184-a00b-9db001f55bd3"
:
{
"0"
:
{
"value"
:
""
}
},
"f64563c6-c102-4836-a5f7-8f9246fcceef"
:
{
"option"
:
{
"0"
:
"direktvermarkter-mit-geschaeft"
,
"1"
:
"premium"
},
"select"
:
"1"
},
"f62d066f-bf0d-42e2-a7ae-6f926fbb49d7"
:
{
"0"
:
{
"value"
:
""
}
},
"915f382b-51fc-48ba-93e0-152040f8f0e4"
:
{
"0"
:
{
"value"
:
""
}
},
"1b99ac64-7879-4802-80d9-0de99613efc9"
:
{
"option"
:
{
"0"
:
"premium"
},
"check"
:
"1"
},
"8cf3f417-4d1c-4795-87de-42124dcb2c20"
:
{
"option"
:
{
"0"
:
"premium"
},
"select"
:
"1"
},
"f118eeff-e254-4155-8e23-8149cb8b5eea"
:
{
"0"
:
{
"value"
:
"Testhof"
}
},
"dbc68015-df76-42ed-a033-503b87e35685"
:
{
"check"
:
"1"
},
"0b13b5c0-bec6-445c-bdf2-e201ba0d43e4"
:
{
"file"
:
""
,
"title"
:
""
,
"link"
:
""
,
"target"
:
"0"
,
"rel"
:
""
,
"lightbox_image"
:
""
,
"spotlight_effect"
:
""
,
"caption"
:
""
},
"17709bb7-acf7-4ef5-8b26-4ed4fe63f8c9"
:
{
"0"
:
{
"value"
:
""
}
},
"3d305054-e356-4c09-8f4c-7795433a4589"
:
{
"file"
:
""
,
"title"
:
""
,
"link"
:
""
,
"target"
:
"0"
,
"rel"
:
""
,
"lightbox_image"
:
""
,
"spotlight_effect"
:
""
,
"caption"
:
""
},
"e8c1fdc9-50e0-4a9b-994a-f48f738dac64"
:
{
},
"ed9cdd4c-ae8b-4ecb-bca7-e12a5153bc02"
:
{
"0"
:
{
"value"
:
"Testen auf dem Testhof"
}
},
"514ccde0-0a79-4594-8b72-b906ee4cede9"
:
{
"0"
:
{
"opening_day"
:
""
,
"opening_from"
:
""
,
"opening_to"
:
""
}
},
"810a6deb-46f2-4fa8-b779-bb5c2a6b5577"
:
{
"0"
:
{
"option"
:
{
"0"
:
"default"
},
"dayoption"
:
{
"0"
:
"1"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
""
,
"opening_day_to"
:
""
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"18:00"
},
"1"
:
{
"option"
:
{
"0"
:
"default"
},
"dayoption"
:
{
"0"
:
"2"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
""
,
"opening_day_to"
:
""
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"12:00"
},
"2"
:
{
"option"
:
{
"0"
:
"default"
},
"dayoption"
:
{
"0"
:
"2"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
""
,
"opening_day_to"
:
""
,
"opening_from"
:
"13:00"
,
"opening_to"
:
"18:00"
},
"3"
:
{
"option"
:
{
"0"
:
"default"
},
"dayoption"
:
{
"0"
:
"8"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
""
,
"opening_day_to"
:
""
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"18:00"
},
"4"
:
{
"option"
:
{
"0"
:
"repeatable"
},
"dayoption"
:
{
"0"
:
"3"
},
"repeatoption"
:
{
"0"
:
"3"
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
""
,
"opening_day_to"
:
""
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"18:00"
},
"5"
:
{
"option"
:
{
"0"
:
"repeatable"
},
"dayoption"
:
{
"0"
:
"4"
},
"repeatoption"
:
{
"0"
:
"14"
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
"02.01"
,
"opening_day_to"
:
""
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"18:00"
},
"6"
:
{
"option"
:
{
"0"
:
"season"
},
"dayoption"
:
{
"0"
:
"5"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
"25.05"
,
"opening_day_to"
:
"30.11"
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"18:00"
},
"7"
:
{
"option"
:
{
"0"
:
"holiday"
},
"dayoption"
:
{
"0"
:
"1"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
"0"
},
"opening_day_from"
:
""
,
"opening_day_to"
:
""
,
"opening_from"
:
"9:00"
,
"opening_to"
:
"18:00"
}
},
"bb74c170-b06f-4d2b-ab88-2f6bf9ce8068"
:
{
"0"
:
{
"option"
:
{
"0"
:
"repeatable"
},
"dayoption"
:
{
"0"
:
"1"
},
"repeatoption"
:
{
"0"
:
"3"
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
"01.01"
,
"opening_day_to"
:
""
,
"opening_from"
:
""
,
"opening_to"
:
""
},
"1"
:
{
"option"
:
{
"0"
:
"season"
},
"dayoption"
:
{
"0"
:
"8"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
"01.01"
,
"opening_day_to"
:
"01.02"
,
"opening_from"
:
""
,
"opening_to"
:
""
},
"2"
:
{
"option"
:
{
"0"
:
"holiday"
},
"dayoption"
:
{
"0"
:
"0"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
"121"
},
"opening_day_from"
:
"01.01"
,
"opening_day_to"
:
""
,
"opening_from"
:
""
,
"opening_to"
:
""
},
"3"
:
{
"option"
:
{
"0"
:
"holiday"
},
"dayoption"
:
{
"0"
:
"0"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
"122"
},
"opening_day_from"
:
"01.01"
,
"opening_day_to"
:
""
,
"opening_from"
:
""
,
"opening_to"
:
""
},
"4"
:
{
"option"
:
{
"0"
:
"holiday"
},
"dayoption"
:
{
"0"
:
"0"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
"123"
},
"opening_day_from"
:
"01.01"
,
"opening_day_to"
:
""
,
"opening_from"
:
""
,
"opening_to"
:
""
},
"5"
:
{
"option"
:
{
"0"
:
"default"
},
"dayoption"
:
{
"0"
:
"0"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
"01.01"
,
"opening_day_to"
:
""
,
"opening_from"
:
""
,
"opening_to"
:
""
},
"6"
:
{
"option"
:
{
"0"
:
"vacation"
},
"dayoption"
:
{
"0"
:
"0"
},
"repeatoption"
:
{
"0"
:
""
},
"holidayoption"
:
{
"0"
:
""
},
"opening_day_from"
:
"01.10"
,
"opening_day_to"
:
"09.10"
,
"opening_from"
:
""
,
"opening_to"
:
""
}
},
"7ac7d682-2862-443b-83bd-8a3cf837ad8e"
:
{
"option"
:
{
"0"
:
"0"
}
},
"6b3b589d-8060-4193-92b9-ce430d96cfdd"
:
{
"0"
:
{
"value"
:
"Immer und t
\u
00e4glich ge
\u
00f6ffnet, au
\u
00dfer es ist niemand da."
}
},
"65359d5a-faca-46b8-8644-767d382d8b9b"
:
{
"option"
:
{
"0"
:
"hinweis"
},
"check"
:
"1"
},
"533ea2dd-e37d-4add-aa73-ad8419040c22"
:
{
"0"
:
{
"value"
:
"Immer und t
\u
00e4glich ge
\u
00f6ffnet, au
\u
00dfer es ist niemand da."
}
},
"6d9ab971-f969-499b-bb6b-9b87b601a961"
:
{
"check"
:
"1"
},
"f67464f3-4475-46a9-a262-11c8a777865d"
:
{
"0"
:
{
"value"
:
"Regoistart GmbH"
}
},
"1d0a9c64-78d4-4767-8617-c8a3a66fc770"
:
{
"0"
:
{
"value"
:
""
}
},
"05192b86-fc84-43cb-81d3-ab804086a873"
:
{
"0"
:
{
"value"
:
""
}
},
"d230a60f-0016-4180-b83a-13e4fd938328"
:
{
"0"
:
{
"value"
:
"regionalkauf.com"
}
},
"c70daef6-ffee-40ef-ba29-3d0065a5aaf5"
:
{
},
"a77f06fc-1561-453c-a429-8dd05cdc29f5"
:
{
"0"
:
{
"value"
:
"<p>Bienenhonig, Met, Propolis, Bl
\u
00fctenpollen. sm
\u
00f6rrebr
\u
00f6d, smoerrebroed roemtoemtoemt
\u
00f6m.<
\/
p>"
}
},
"1a85a7a6-2aba-4480-925b-6b97d311ee6c"
:
{
"0"
:
{
"value"
:
"<p>Bienenhonig, Met, Propolis, Bl
\u
00fctenpollen. supercalafragalisticexpialadoshus, s
\u
00fcpercalafragalisticexpialad
\u
00f6shus<
\/
p>"
}
},
"efd91873-dce0-48fd-b40e-5bc0e9599f3e"
:
{
},
"9ca9fc28-03f8-472d-b49f-8e2513cc8740"
:
{
"file"
:
"images
\/
regionalkaufapp
\/
unternehmen
\/
logo_basis.png"
,
"title"
:
""
,
"link"
:
""
,
"target"
:
"0"
,
"rel"
:
""
,
"lightbox_image"
:
""
,
"spotlight_effect"
:
""
,
"caption"
:
""
,
"width"
:
144
,
"height"
:
145
},
"ffcc1c50-8dbd-4115-b463-b43bdcd44a57"
:
{
"file"
:
"images
\/
regionalkaufapp
\/
unternehmen
\/
logo_basis.png"
,
"title"
:
""
,
"link"
:
""
,
"target"
:
"0"
,
"rel"
:
""
,
"lightbox_image"
:
""
,
"spotlight_effect"
:
""
,
"caption"
:
""
,
"width"
:
144
,
"height"
:
145
},
"e8f08959-19ff-4cfa-ba37-bc42414eeb45"
:
{
"value"
:
"
\/
allgemein"
,
"title"
:
"Die Bilder sind in Vorbereitung."
},
"051452fe-692b-4ce2-8567-7dc4d0343fee"
:
{
"url"
:
""
,
"width"
:
"640"
,
"height"
:
"360"
,
"autoplay"
:
"0"
},
"b68108e0-e49b-420d-97ec-d7c88af2b01a"
:
{
"file"
:
""
,
"hits"
:
"0"
,
"download_limit"
:
""
,
"size"
:
0
},
"92fda174-119b-4ee7-b14c-98c7f65224de"
:
{
},
"4339a108-f907-4661-9aab-d6f3f00e736e"
:
{
"0"
:
{
"value"
:
"Dr.Theobald-Schrems-Stra
\u
00dfe 4"
}
},
"ea0666d7-51e3-4e52-8617-25e3ad61f8b8"
:
{
"0"
:
{
"value"
:
"93055"
}
},
"90a18889-884b-4d53-a302-4e6e4595efa0"
:
{
"0"
:
{
"value"
:
"Regensburg"
}
},
"160bd40a-3e0e-48de-b6cd-56cdcc9db892"
:
{
"location"
:
"49.0146337, 12.111873899999978"
},
"9ff517f0-d029-4e85-a411-fdb2bbae3b8c"
:
{
"location"
:
"49.0146337, 12.111873899999978"
},
"33bfd53b-1f42-4628-bb3d-461cacecdd84"
:
{
"0"
:
{
"value"
:
"12.111873899999978, 49.0146337"
}
},
"7516ee89-8702-4675-806b-58fe5bc56305"
:
{
},
"b870164b-fe78-45b0-b840-8ebceb9b9cb6"
:
{
"0"
:
{
"value"
:
"0941 56959760"
}
},
"272860a4-9ba0-4303-b2d3-77abb8d6fd42"
:
{
"0"
:
{
"value"
:
"0941 56959768"
}
},
"5dcfa5ab-3769-4c5e-8cd2-1ac91643be70"
:
{
"0"
:
{
"value"
:
"0941 56959768"
}
},
"8a91aab2-7862-4a04-bd28-07f1ff4acce5"
:
{
"0"
:
{
"value"
:
"0941 56959769"
}
},
"3f15b5e4-0dea-4114-a870-1106b85248de"
:
{
"0"
:
{
"value"
:
"mb@regiostart.com"
,
"text"
:
""
,
"subject"
:
""
,
"body"
:
""
}
},
"0b3d983e-b2fa-4728-afa0-a0b640fa34dc"
:
{
"0"
:
{
"value"
:
"http:
\/\/
regiostart.com"
,
"text"
:
""
,
"target"
:
"1"
,
"custom_title"
:
""
,
"rel"
:
""
}
},
"b7628b63-d551-4b14-ac70-27cf0c6e95fc"
:
{
"0"
:
{
"value"
:
"http:
\/\/
myreg.io
\/
g"
}
},
"2081965c-c781-4ae1-99c3-54b959145cfe"
:
{
"value"
:
"1"
},
"8eeeb531-0dc3-415a-8f4a-c7f88d1ac627"
:
{
"value"
:
"1"
},
"9bd1d374-6a54-4054-be1e-87839eb24fb6"
:
{
},
"7056f1d2-5253-40b6-8efd-d289b10a8c69"
:
{
"item"
:
{
"0"
:
"2423"
}
},
"6eaab8b7-b4f5-4d3c-8193-db3542aec0a5"
:
{
},
"c59ac5ce-2011-44b9-846f-e9cb73857b33"
:
{
},
"e2221aa5-853b-4a8c-aeb1-53a97efa6995"
:
{
},
"9eeb4b7d-f289-4137-91ea-5275bb3376a7"
:
{
},
"23685df7-81bb-4c25-a14a-18e2c42a4caf"
:
{
},
"cf6dd846-5774-47aa-8ca7-c1623c06e130"
:
{
"votes"
:
"1"
,
"value"
:
"5.0000"
},
"cffd7b0a-317a-4cf9-852e-65fd31526a53"
:
{
"votes"
:
"1"
}
}
\ No newline at end of file
timeUtils.js
View file @
2704d42b
...
...
@@ -34,10 +34,10 @@ function _standard(day, timeFrom, timeUntil, epochStart, epochEnd, distanceDays)
return
_cyclicInterval
(
startDate
,
endDate
,
distanceDays
*
24
*
3600000
,
epochStart
,
epochEnd
);
}
function
standardFromTillDay
(
dayFrom
,
dayTill
,
timeFrom
,
timeUntil
,
epochStart
,
epochEnd
,
d
istanceDays
)
{
function
standardFromTillDay
(
dayFrom
,
dayTill
,
timeFrom
,
timeUntil
,
epochStart
,
epochEnd
,
d
aysDistance
)
{
timeUntil
=
transformTill
(
timeFrom
,
timeUntil
);
var
firstDays
=
_standard
(
dayFrom
,
timeFrom
,
timeUntil
,
epochStart
,
epochEnd
,
d
istanceDays
);
var
firstDays
=
_standard
(
dayFrom
,
timeFrom
,
timeUntil
,
epochStart
,
epochEnd
,
d
aysDistance
);
var
result
=
firstDays
.
slice
();
for
(
var
offset
=
1
;
offset
<=
dayTill
-
dayFrom
;
offset
++
)
{
...
...
@@ -155,6 +155,13 @@ function _getNextNoInMonthOccurence(day, startDate, noInMonth) {
return
startDate
;
}
function
singleDay
(
date
)
{
var
startDate
=
new
Date
(
date
.
getFullYear
(),
date
.
getMonth
(),
date
.
getDate
());
var
endDate
=
new
Date
(
startDate
);
endDate
.
setDate
(
endDate
.
getDate
()
+
1
);
return
[[
startDate
,
endDate
]];
}
function
orOperator
(
intervals
)
{
var
result
=
[];
...
...
@@ -246,8 +253,8 @@ function andNotOperator(interval1, interval2) {
}
module
.
exports
.
standardFromTillDay
=
standardFromTillDay
;
module
.
exports
.
cyclic
=
cyclic
;
module
.
exports
.
cyclicFromTillDay
=
cyclicFromTillDay
;
module
.
exports
.
singleDay
=
singleDay
;
module
.
exports
.
orOperator
=
orOperator
;
module
.
exports
.
andOperator
=
andOperator
;
module
.
exports
.
andNotOperator
=
andNotOperator
;
...
...
todo
View file @
2704d42b
endzeit kleiner anfangszeit ==> endzeit + 24
\ No newline at end of file
feiertage defaultmaessig abziehen
verbindung feiertag - region
\ 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