Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
whats-open-web
Commits
7e154b7c
Commit
7e154b7c
authored
Apr 30, 2017
by
mdsecurity
Browse files
fixed issue where sunday was reperesented as -1 instead of 6
parent
437da7ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/app/place-window/area/place-card/place-card.component.ts
View file @
7e154b7c
...
...
@@ -24,7 +24,8 @@ export class PlaceCardComponent implements OnInit {
}
openInContext
()
{
this
.
dataProvider
.
setContext
(
this
.
place
);
console
.
log
(
this
.
place
.
openFor
().
hour
+
"
"
+
this
.
place
.
openFor
().
minute
+
"
"
+
this
.
place
.
openFor
().
second
)
// console.log(this.place.openFor().hour+ " "+ this.place.openFor().minute+ " "+ this.place.openFor().second)
console
.
log
(
this
.
place
);
}
openDialog
()
{
let
dialogRef
=
this
.
dialog
.
open
(
FeedbackDialogComponent
);
...
...
src/app/place.ts
View file @
7e154b7c
...
...
@@ -25,12 +25,13 @@ export class Place {
isOpen
():
boolean
{
const
currTime
=
new
Date
();
const
inSeconds
=
currTime
.
getHours
()
*
60
*
60
+
currTime
.
getMinutes
()
*
60
+
currTime
.
getSeconds
();
const
dayOfWeek
=
currTime
.
getDay
()
-
1
;
const
dayOfWeekShift
=
[
6
,
5
,
4
,
3
,
2
,
1
,
0
];
const
dayOfWeek
=
dayOfWeekShift
[
currTime
.
getDay
()];
const
useSpecialSchedule
=
this
.
useSpecial
();
let
schedule
;
if
(
useSpecialSchedule
===
-
1
){
if
(
useSpecialSchedule
===
-
1
)
{
schedule
=
this
.
main_schedule_times
;
}
else
{
}
else
{
schedule
=
this
.
special_schedules
[
useSpecialSchedule
].
openTimes
;
}
for
(
let
i
=
0
;
i
<
schedule
.
length
;
i
++
)
{
...
...
@@ -59,20 +60,21 @@ export class Place {
const
currTime
=
new
Date
();
const
today
=
currTime
.
getDay
()
-
1
;
const
inSeconds
=
currTime
.
getHours
()
*
60
*
60
+
currTime
.
getMinutes
()
*
60
+
currTime
.
getSeconds
();
const
dayOfWeek
=
currTime
.
getDay
()
-
1
;
const
dayOfWeekShift
=
[
6
,
5
,
4
,
3
,
2
,
1
,
0
];
const
dayOfWeek
=
dayOfWeekShift
[
currTime
.
getDay
()];
const
useSpecialSchedule
=
this
.
useSpecial
();
let
timeTilClose
=
new
Time
();
let
sumSeconds
=
0
;
let
schedule
;
if
(
useSpecialSchedule
===
-
1
){
if
(
useSpecialSchedule
===
-
1
)
{
schedule
=
this
.
main_schedule_times
;
}
else
{
}
else
{
schedule
=
this
.
special_schedules
[
useSpecialSchedule
].
openTimes
;
}
// clean up if statements later
if
(
this
.
isOpen
())
{
//
if (this.isOpen()) {
for
(
let
i
=
0
;
i
<
schedule
.
length
;
i
++
)
{
const
day
=
schedule
[
i
];
if
(
day
.
end_day
!==
day
.
start_day
)
{
...
...
@@ -87,9 +89,9 @@ export class Place {
return
timeTilClose
.
fromSeconds
(
sumSeconds
);
}
}
else
{
//
} else {
return
timeTilClose
;
}
//
}
}
useSpecial
():
number
{
...
...
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