Fixed midnight reset
This commit is contained in:
@@ -121,7 +121,7 @@ export default {
|
||||
|
||||
.categories {
|
||||
display: flex;
|
||||
margin: 0 32px;
|
||||
margin: 0 64px 0 32px;
|
||||
overflow-x: scroll;
|
||||
|
||||
.category {
|
||||
@@ -157,8 +157,8 @@ export default {
|
||||
|
||||
.settings {
|
||||
position: fixed;
|
||||
bottom: 8px;
|
||||
right: 8px;
|
||||
bottom: 16px;
|
||||
right: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,8 @@ export default {
|
||||
beforeMount() {
|
||||
const lastMidnight = new Date();
|
||||
lastMidnight.setHours(0, 0, 0, 0);
|
||||
if (this.midnightReset && this.lastReset < lastMidnight) {
|
||||
const lastReset = new Date(this.lastReset);
|
||||
if (this.midnightReset && lastReset < lastMidnight) {
|
||||
this.resetTasks();
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
<template>
|
||||
<div class="task-list">
|
||||
<div>
|
||||
<input
|
||||
class="add-task"
|
||||
v-model=newTask
|
||||
placeholder="Add new task"
|
||||
@keypress.enter="addTask"
|
||||
/>
|
||||
|
||||
</div>
|
||||
<Task
|
||||
v-for="task in filteredTasks"
|
||||
:key="task.startedAt"
|
||||
|
||||
Reference in New Issue
Block a user