# HG changeset patch # User Thomas Junk # Date 1554466999 -7200 # Node ID 1775ffa65504d6a2026e9804a5a029a82e82edda # Parent 91539caae6116c2ddf330cec346ca658160cd4f8 import_overview: fix time calculation diff -r 91539caae611 -r 1775ffa65504 client/src/components/importoverview/ImportOverview.vue --- a/client/src/components/importoverview/ImportOverview.vue Fri Apr 05 13:55:45 2019 +0200 +++ b/client/src/components/importoverview/ImportOverview.vue Fri Apr 05 14:23:19 2019 +0200 @@ -191,32 +191,7 @@ if (id) this.showSingleRessource(id); }, selectedInterval() { - const now = new Date(); - switch (this.selectedInterval) { - case this.$options.LAST_HOUR: - this.$store.commit("imports/setStartDate", startOfHour(now)); - this.$store.commit("imports/setEndDate", now); - break; - case this.$options.TODAY: - this.$store.commit("imports/setStartDate", startOfDay(now)); - this.$store.commit("imports/setEndDate", now); - break; - case this.$options.LAST_7_DAYS: - this.$store.commit( - "imports/setStartDate", - subDays(startOfDay(now), 7) - ); - this.$store.commit("imports/setEndDate", now); - break; - case this.$options.LAST_30_DAYS: - this.$store.commit( - "imports/setStartDate", - subDays(startOfDay(now), 30) - ); - this.$store.commit("imports/setEndDate", now); - break; - } - this.loadLogs(); + this.loadUpdatedLogs(); }, imports() { if (this.imports.length == 0) { @@ -312,9 +287,31 @@ return this.imports; }, loadUpdatedLogs() { - const [start, end] = this.determineInterval(new Date()); - this.$store.commit("imports/setStartDate", start); - this.$store.commit("imports/setEndDate", end); + const now = new Date(); + switch (this.selectedInterval) { + case this.$options.LAST_HOUR: + this.$store.commit("imports/setStartDate", startOfHour(now)); + this.$store.commit("imports/setEndDate", now); + break; + case this.$options.TODAY: + this.$store.commit("imports/setStartDate", startOfDay(now)); + this.$store.commit("imports/setEndDate", now); + break; + case this.$options.LAST_7_DAYS: + this.$store.commit( + "imports/setStartDate", + subDays(startOfDay(now), 7) + ); + this.$store.commit("imports/setEndDate", now); + break; + case this.$options.LAST_30_DAYS: + this.$store.commit( + "imports/setStartDate", + subDays(startOfDay(now), 30) + ); + this.$store.commit("imports/setEndDate", now); + break; + } this.loadLogs(); }, loadLogs() {