-
Notifications
You must be signed in to change notification settings - Fork 1
/
annex.tex
60 lines (54 loc) · 1.51 KB
/
annex.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
\appendix
\pagenumbering{Alph}
\renewcommand{\thechapter}{\Alph{chapter}}
\renewcommand{\thesection}{\Roman{section}}
\renewcommand{\thesubsection}{\Roman{subsection}}
\renewcommand\floatpagefraction{0.1}
\clearpage
\chapter{Anhang}
\label{appendix:annex}
\section{Bilder}
\label{annex:images}
\begin{figure}[ht!]
\begin{centering}
\includegraphics[width=1\textwidth]{figures/implementation/firestore-user.png}
\caption{Benutzerdatensatz in Firestore}
\label{fig:firestoreUser}
\end{centering}
\end{figure}
\begin{figure}[ht!]
\begin{centering}
\includegraphics[width=.75\textwidth]{figures/implementation/details.png}
\caption{Beitragsdetails}
\label{fig:details}
\end{centering}
\end{figure}
\clearpage
\section{Code}
\label{annex:code}
\begin{lstlisting}[language=JavaScript, label=code:filterPosts, title={Filterfunktion der Beiträge}]
const filtered = posts
.filter((post) => !currentUser?.blocked?.includes(post.author.id))
.filter((post) => {
// check validity
if (currentUser?.id === post.author.id) {
return true
}
if (!(post.validityStart && post.validityEnd)) {
// no validity set
return true
}
console.log(
moment(post.validityStart).toDate().getTime(),
moment(post.validityStart).toDate().getTime() <= new Date().getTime(),
)
if (
moment(post.validityStart).toDate().getTime() >= new Date().getTime() &&
moment(post.validityEnd).toDate().getTime() <= new Date().getTime()
) {
return true
} else {
return false
}
})
\end{lstlisting}