Skip to content

Commit 20cc381

Browse files
committed
Add some comments
1 parent 6b31e43 commit 20cc381

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/components/NewTodo.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ import { Difficulty, Priority, RepeatInterval } from "./TodoList.vue";
6666
import { defineComponent } from "vue";
6767
6868
export interface TodoTask {
69+
//todo task interface
6970
task: string; //task name
7071
dueDate: Date; //task due date
7172
priority: number; //task priority
@@ -78,14 +79,15 @@ export interface TodoTask {
7879
streak: number; //task completion streak
7980
originalDueDate: Date; //task original due date in YYYY-MM-DD string
8081
}
81-
const currentUtcDate: Date = new Date();
82+
const currentUtcDate: Date = new Date(); //current UTC date
8283
const currentLocalDate: Date = new Date(
8384
currentUtcDate.setMinutes(
8485
currentUtcDate.getMinutes() - currentUtcDate.getTimezoneOffset(),
8586
),
86-
);
87+
); //currect date in local time zone
8788
8889
export default defineComponent({
90+
//define component to default values when task is created
8991
data() {
9092
return {
9193
task: "",
@@ -107,7 +109,7 @@ export default defineComponent({
107109
mounted() {
108110
const dueDateInput = document.getElementById(
109111
"due-date",
110-
) as HTMLInputElement;
112+
) as HTMLInputElement; //get due date value as input element
111113
dueDateInput.min = currentLocalDate.toISOString().split("T")[0]; //task minimum due date must be today
112114
},
113115
methods: {

0 commit comments

Comments
 (0)