Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
AStA
Raumbuchungstool
Commits
c8dda603
Commit
c8dda603
authored
Sep 24, 2020
by
Michael Koch
Browse files
We can do even better.
parent
d8cda71f
Changes
1
Hide whitespace changes
Inline
Side-by-side
js/refresh.js
View file @
c8dda603
...
...
@@ -150,26 +150,26 @@ function refreshReservations() {
if
(
r
.
result
===
"
success
"
)
{
if
(
!
_
.
isEqual
(
r
.
content
,
_reservations
)
||
forceReload
)
{
if
(
r
.
content
)
{
let
fromtime
=
dayjs
(
_validateDate
(
r
.
preparation
.
from
,
'
YYYY-MM-DD HH:mm
'
)
?
r
.
preparation
.
from
:
r
.
event
.
from
);
let
totime
=
dayjs
(
_validateDate
(
r
.
preparation
.
to
,
'
YYYY-MM-DD HH:mm
'
)
?
r
.
preparation
.
to
:
r
.
event
.
to
);
let
fromtime
=
(
resv
)
=>
dayjs
(
_validateDate
(
r
esv
.
preparation
.
from
,
'
YYYY-MM-DD HH:mm
'
)
?
r
esv
.
preparation
.
from
:
r
esv
.
event
.
from
);
let
totime
=
(
resv
)
=>
dayjs
(
_validateDate
(
r
esv
.
preparation
.
to
,
'
YYYY-MM-DD HH:mm
'
)
?
r
esv
.
preparation
.
to
:
r
esv
.
event
.
to
);
_reservations
.
all
=
r
.
content
;
_reservations
.
open
.
upcoming
=
$
.
grep
(
_reservations
.
all
,
(
r
,
i
)
=>
r
.
confirmed
===
0
&&
r
.
denied
===
0
&&
totime
>=
now
);
_reservations
.
open
.
total
=
$
.
grep
(
_reservations
.
all
,
(
r
,
i
)
=>
r
.
confirmed
===
0
&&
r
.
denied
===
0
);
_reservations
.
confirmed
.
upcoming
=
$
.
grep
(
_reservations
.
all
,
(
r
,
i
)
=>
r
.
confirmed
===
1
&&
totime
>=
now
);
_reservations
.
confirmed
.
total
=
$
.
grep
(
_reservations
.
all
,
(
r
,
i
)
=>
r
.
confirmed
===
1
);
_reservations
.
denied
.
upcoming
=
$
.
grep
(
_reservations
.
all
,
(
r
,
i
)
=>
r
.
denied
===
1
&&
totime
>=
now
);
_reservations
.
denied
.
total
=
$
.
grep
(
_reservations
.
all
,
(
r
,
i
)
=>
r
.
denied
===
1
);
_reservations
.
archived
=
$
.
grep
(
_reservations
.
all
,
(
r
,
i
)
=>
totime
<=
now
);
_reservations
.
current
=
$
.
grep
(
_reservations
.
all
,
(
r
,
i
)
=>
fromtime
<=
now
&&
totime
>=
now
);
_reservations
.
upcoming
.
total
=
$
.
grep
(
_reservations
.
all
,
(
r
,
i
)
=>
fromtime
>=
now
);
_reservations
.
upcoming
.
month6
=
$
.
grep
(
_reservations
.
upcoming
.
total
,
(
r
,
i
)
=>
fromtime
>=
now
&&
fromtime
<=
_addDays
(
now
,
180
));
_reservations
.
upcoming
.
month3
=
$
.
grep
(
_reservations
.
upcoming
.
month6
,
(
r
,
i
)
=>
fromtime
>=
now
&&
fromtime
<=
_addDays
(
now
,
90
));
_reservations
.
upcoming
.
month1
=
$
.
grep
(
_reservations
.
upcoming
.
month3
,
(
r
,
i
)
=>
fromtime
>=
now
&&
fromtime
<=
_addDays
(
now
,
30
));
_reservations
.
upcoming
.
week2
=
$
.
grep
(
_reservations
.
upcoming
.
month1
,
(
r
,
i
)
=>
fromtime
>=
now
&&
fromtime
<=
_addDays
(
now
,
14
));
_reservations
.
upcoming
.
week1
=
$
.
grep
(
_reservations
.
upcoming
.
week2
,
(
r
,
i
)
=>
fromtime
>=
now
&&
fromtime
<=
_addDays
(
now
,
7
));
_reservations
.
lernsprint
=
$
.
grep
(
_reservations
.
all
,
(
r
,
i
)
=>
r
.
room
.
room_type
===
1
);
_reservations
.
studyspace
=
$
.
grep
(
_reservations
.
all
,
(
r
,
i
)
=>
r
.
room
.
room_type
===
5
);
_reservations
.
open
.
upcoming
=
$
.
grep
(
_reservations
.
all
,
(
r
esv
,
i
)
=>
r
esv
.
confirmed
===
0
&&
r
esv
.
denied
===
0
&&
totime
(
resv
)
>=
now
);
_reservations
.
open
.
total
=
$
.
grep
(
_reservations
.
all
,
(
r
esv
,
i
)
=>
r
esv
.
confirmed
===
0
&&
r
esv
.
denied
===
0
);
_reservations
.
confirmed
.
upcoming
=
$
.
grep
(
_reservations
.
all
,
(
r
esv
,
i
)
=>
r
esv
.
confirmed
===
1
&&
totime
(
resv
)
>=
now
);
_reservations
.
confirmed
.
total
=
$
.
grep
(
_reservations
.
all
,
(
r
esv
,
i
)
=>
r
esv
.
confirmed
===
1
);
_reservations
.
denied
.
upcoming
=
$
.
grep
(
_reservations
.
all
,
(
r
esv
,
i
)
=>
r
esv
.
denied
===
1
&&
totime
(
resv
)
>=
now
);
_reservations
.
denied
.
total
=
$
.
grep
(
_reservations
.
all
,
(
r
esv
,
i
)
=>
r
esv
.
denied
===
1
);
_reservations
.
archived
=
$
.
grep
(
_reservations
.
all
,
(
r
esv
,
i
)
=>
totime
(
resv
)
<=
now
);
_reservations
.
current
=
$
.
grep
(
_reservations
.
all
,
(
r
esv
,
i
)
=>
fromtime
(
resv
)
<=
now
&&
totime
(
resv
)
>=
now
);
_reservations
.
upcoming
.
total
=
$
.
grep
(
_reservations
.
all
,
(
r
esv
,
i
)
=>
fromtime
(
resv
)
>=
now
);
_reservations
.
upcoming
.
month6
=
$
.
grep
(
_reservations
.
upcoming
.
total
,
(
r
esv
,
i
)
=>
fromtime
(
resv
)
>=
now
&&
fromtime
(
resv
)
<=
_addDays
(
now
,
180
));
_reservations
.
upcoming
.
month3
=
$
.
grep
(
_reservations
.
upcoming
.
month6
,
(
r
esv
,
i
)
=>
fromtime
(
resv
)
>=
now
&&
fromtime
(
resv
)
<=
_addDays
(
now
,
90
));
_reservations
.
upcoming
.
month1
=
$
.
grep
(
_reservations
.
upcoming
.
month3
,
(
r
esv
,
i
)
=>
fromtime
(
resv
)
>=
now
&&
fromtime
(
resv
)
<=
_addDays
(
now
,
30
));
_reservations
.
upcoming
.
week2
=
$
.
grep
(
_reservations
.
upcoming
.
month1
,
(
r
esv
,
i
)
=>
fromtime
(
resv
)
>=
now
&&
fromtime
(
resv
)
<=
_addDays
(
now
,
14
));
_reservations
.
upcoming
.
week1
=
$
.
grep
(
_reservations
.
upcoming
.
week2
,
(
r
esv
,
i
)
=>
fromtime
(
resv
)
>=
now
&&
fromtime
(
resv
)
<=
_addDays
(
now
,
7
));
_reservations
.
lernsprint
=
$
.
grep
(
_reservations
.
all
,
(
r
esv
,
i
)
=>
r
esv
.
room
.
room_type
===
1
);
_reservations
.
studyspace
=
$
.
grep
(
_reservations
.
all
,
(
r
esv
,
i
)
=>
r
esv
.
room
.
room_type
===
5
);
}
else
{
_reservations
=
{
'
open
'
:
{
...
...
Write
Preview
Supports
Markdown
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