Skip to content

Commit

Permalink
[FE] FIX: calcHours 반올림에서 버림으로 변경 #75
Browse files Browse the repository at this point in the history
42inshin committed Dec 13, 2023
1 parent d052378 commit e11b1de
Showing 2 changed files with 7 additions and 11 deletions.
17 changes: 7 additions & 10 deletions src/stores/home.ts
Original file line number Diff line number Diff line change
@@ -35,7 +35,6 @@ export const useHomeStore = defineStore("home", () => {

const numberOfPeople = ref({
gaepo: 0,
seocho: 0,
});

const infoMessages = ref({
@@ -168,7 +167,6 @@ export const useHomeStore = defineStore("home", () => {
};

const getInfoMessages = () => {
console.log(infoMessages.value);
return infoMessages.value;
};

@@ -184,7 +182,6 @@ export const useHomeStore = defineStore("home", () => {
};
numberOfPeople.value = {
gaepo: mainInfo.gaepo,
seocho: mainInfo.seocho,
};
infoMessages.value = mainInfo.infoMessages;
} catch (error) {
@@ -198,9 +195,9 @@ export const useHomeStore = defineStore("home", () => {
return { hour, minute };
};

const calHours = (time: number) => {
const str = (time / 3600).toFixed(1);
return str;
const calcHours = (time: number) => {
const str = Math.floor((time / 3600) * 10) / 10;
return str.toString();
};

const calcWeely = (index: number) => {
@@ -232,14 +229,14 @@ export const useHomeStore = defineStore("home", () => {
tempData = tempData.map((data, index) => {
return {
periods: calcWeely(index),
total: calHours(weeklyAccTime.value[index]),
total: calcHours(weeklyAccTime.value[index]),
};
});
} else {
tempData = dumyData.map((data, index) => {
return {
periods: calcWeely(index),
total: calHours(weeklyAccTime.value[index]),
total: calcHours(weeklyAccTime.value[index]),
};
});
}
@@ -262,14 +259,14 @@ export const useHomeStore = defineStore("home", () => {
tempData = tempData.map((data, index) => {
return {
periods: calcMonthly(index),
total: calHours(monthlyAccTime.value[index]),
total: calcHours(monthlyAccTime.value[index]),
};
});
} else {
tempData = dumyData.map((data, index) => {
return {
periods: calcMonthly(index),
total: calHours(monthlyAccTime.value[index]),
total: calcHours(monthlyAccTime.value[index]),
};
});
}
1 change: 0 additions & 1 deletion src/stores/monthlog.ts
Original file line number Diff line number Diff line change
@@ -299,7 +299,6 @@ export const useMonthLogStore = defineStore("MonthLog", () => {
const updatedAt = logsContainer.value.find(
(log) => log.date === `${showYear()}. ${showMonth() + 1}`
)?.updatedAt;
console.log(updatedAt);
if (updatedAt) {
const date = new Date(updatedAt);
if (date.getFullYear() > showYear() || date.getMonth() > showMonth()) {

0 comments on commit e11b1de

Please sign in to comment.