From bd02cc79c7d0039899661aa60057a193c49c6f2f Mon Sep 17 00:00:00 2001 From: Matthew Huntington Date: Wed, 21 Aug 2024 19:34:24 +0200 Subject: [PATCH] setting up fixed decimal values for mins left, get ahead, practiced --- .../mins_left_to_practice_today.vue | 29 ++++++++----------- src/components/timer.vue | 10 +------ 2 files changed, 13 insertions(+), 26 deletions(-) diff --git a/src/components/mins_left_to_practice_today.vue b/src/components/mins_left_to_practice_today.vue index 495ba3b..1da1119 100644 --- a/src/components/mins_left_to_practice_today.vue +++ b/src/components/mins_left_to_practice_today.vue @@ -10,24 +10,19 @@ } }, methods: { - refresh(){ - axios.get(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'mins-left-to-practice-today').then((response)=>{ - this.time_left= response.data.time_left; - this.mins_practiced_today = response.data.mins_practiced_today; - - const today = new Date() - this.to_get_ahead = this.time_left + (today.getMonth()+1)*150 + today.getDate()*5 - }) - } - }, - mounted() { - axios.get(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'mins-left-to-practice-today').then((response)=>{ + setTimes(response){ this.time_left= response.data.time_left; this.mins_practiced_today = response.data.mins_practiced_today; - + const today = new Date() this.to_get_ahead = this.time_left + (today.getMonth()+1)*150 + today.getDate()*5 - }) + }, + refresh(){ + axios.get(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'mins-left-to-practice-today').then(this.setTimes) + } + }, + mounted() { + axios.get(import.meta.env.VITE_PRACTICE_TRACKER_API_URL+'mins-left-to-practice-today').then(this.setTimes) } } @@ -35,11 +30,11 @@