mirror of
https://github.com/urosran/cally.git
synced 2025-07-10 15:17:17 +00:00
- Implemented spending of the saved points
This commit is contained in:
@ -140,7 +140,7 @@ export const useUpdateTodo = () => {
|
||||
Sunday: 0,
|
||||
};
|
||||
|
||||
const currentDay = getCurrentDay(todoUpdate.date);
|
||||
const currentDay = getSelectedDateDay(todoUpdate.date);
|
||||
const updatedPointsPerDay = todoData.done
|
||||
? pointsPerDay[currentDay] + todoUpdate.points
|
||||
: pointsPerDay[currentDay] - todoUpdate.points;
|
||||
@ -185,7 +185,7 @@ export const useUpdateTodo = () => {
|
||||
})
|
||||
};
|
||||
|
||||
const getCurrentDay = (date) => {
|
||||
const getSelectedDateDay = (date) => {
|
||||
let selectedDate = new Date(date.seconds * 1000);
|
||||
const days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
||||
return days[selectedDate.getDay()];
|
||||
|
Reference in New Issue
Block a user