From 823957da7ebf3d7420b44c9ceddaf3a06a921a2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Sat, 27 Jun 2020 13:10:57 +0200 Subject: [PATCH] add impressum, datenschutz und bugs --- src/App.vue | 77 ++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 71 insertions(+), 6 deletions(-) diff --git a/src/App.vue b/src/App.vue index 417b731..523ad2d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -3,12 +3,28 @@ - © {{ new Date().getFullYear() }} Studentenclub Wu 5 e.v. + © {{ new Date().getFullYear() }} Studentenclub Wu5 e.V. + + + + Impressum + + + Datenschutzerklärung + + + Bugs? + +
- + {{ calcTime }} + + {{ calcTimeLittle }} +
@@ -23,11 +52,18 @@ Zeit bis zum Logout ändern - + - Abbrechen + Abbrechen Speichern @@ -152,6 +188,35 @@ export default { } else { return minutesString + ':' + secondsString + ' Minuten bis zum Logout' } + }, + calcTimeLittle() { + var minutes = this.lifeTime / 60 + var seconds = this.lifeTime % 60 + var minutesString = + minutes < 10 ? '0' + Math.floor(minutes % 60) : Math.floor(minutes % 60) + var secondsString = + seconds < 10 ? '0' + Math.floor(seconds) : Math.floor(seconds) + if (minutes > 60) { + var hours = minutes / 60 + if (hours > 24) { + var days = hours / 24 + var now = new Date() + var dayMonth = new Date( + now.getFullYear(), + now.getMonth() + 1, + 0 + ).getDate() + if (days >= dayMonth) { + return Math.floor(days / dayMonth) + 'M' + } else { + return Math.floor(days) + 'D' + } + } else { + return Math.floor(hours) + ':' + minutesString + ':' + secondsString + } + } else { + return minutesString + ':' + secondsString + } } }, beforeDestroy() {