diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..ff5b298 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,17 @@ +# Ignore the node_modules directory +node_modules + +# Ignore the dist directory +www + +# Ignore the .git directory +.git + +# Ignore the .gitignore file +.gitignore + +# Ignore the .dockerignore file +.dockerignore +Dockerfile + +.vscode/* diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5a794b1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM node:18-slim as node +WORKDIR /app +COPY . . +RUN npm install +RUN npm install -g @ionic/cli +RUN ionic build --prod + +FROM nginx:latest AS ngi +COPY --from=node /app/www /usr/share/nginx/html +COPY /nginx.conf /etc/nginx/conf.d/default.conf +EXPOSE 80 diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..b3be85a --- /dev/null +++ b/nginx.conf @@ -0,0 +1,20 @@ +server { + listen 80; + sendfile on; + default_type application/octet-stream; + + gzip on; + gzip_http_version 1.1; + gzip_disable "MSIE [1-6]\."; + gzip_min_length 256; + gzip_vary on; + gzip_proxied expired no-cache no-store private auth; + gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript; + gzip_comp_level 9; + + root /usr/share/nginx/html; + + location / { + try_files $uri $uri/ /index.html =404; + } +} diff --git a/src/app/tabs/tabs.page.html b/src/app/tabs/tabs.page.html index 02f7742..595eaf1 100644 --- a/src/app/tabs/tabs.page.html +++ b/src/app/tabs/tabs.page.html @@ -5,12 +5,12 @@ Erfassen - + Analyse - + Einstellungen diff --git a/src/app/time/time.page.html b/src/app/time/time.page.html index 0d6a615..107787c 100644 --- a/src/app/time/time.page.html +++ b/src/app/time/time.page.html @@ -35,23 +35,23 @@ - + {{currentAction === 'login' ? "Einstempeln" : "Ausstempeln"}} - + - + - Cancel + Abbrechen Welcome - Confirm + Speichern @@ -67,7 +67,7 @@ - + Einstempeln Ausstempeln Dienstreise starten diff --git a/src/app/time/time.page.ts b/src/app/time/time.page.ts index 2f3859b..9fe1cb8 100644 --- a/src/app/time/time.page.ts +++ b/src/app/time/time.page.ts @@ -53,8 +53,8 @@ export class TimePage { } public getEntriesOfToday(): TimeEntry[] { - const today = new Date(this.currentDate || Date.now()).getDay(); - return this.data.filter(entry => entry.registeredAt.getDay() === today); + const today = new Date(this.currentDate || Date.now()).toLocaleDateString(); + return this.data.filter(entry => entry.registeredAt.toLocaleDateString() === today); } public getTypeText(type: TimeType): string { @@ -117,6 +117,10 @@ export class TimePage { localStorage.setItem("time-data", JSON.stringify(this.data)); } + public openModal(): void { + this.modal?.present(); + } + public addModalEntry(): void { const date = new Date(this.modalDate); date.setSeconds(0); @@ -137,4 +141,10 @@ export class TimePage { this.saveData(); this.modal?.dismiss(null, 'submit'); } + + public isToday(): boolean { + return new Date(this.currentDate || Date.now()).toLocaleDateString() === new Date(Date.now()).toLocaleDateString(); + } + + protected readonly open = open; } diff --git a/src/assets/icon/favicon.png b/src/assets/icon/favicon.png index 2b1c739..59145cd 100644 Binary files a/src/assets/icon/favicon.png and b/src/assets/icon/favicon.png differ