Skip to content

Commit 431802e

Browse files
committed
Fix spelling and grammar mistakes
1 parent 0f968c3 commit 431802e

File tree

3 files changed

+43
-43
lines changed

3 files changed

+43
-43
lines changed

public/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<body>
1111
<noscript>
1212
<strong
13-
>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work
13+
>We're sorry: <%= htmlWebpackPlugin.options.title %> doesn't work
1414
properly without JavaScript enabled. Please enable it to
1515
continue.</strong
1616
>

src/components/NewTask.vue

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -84,26 +84,26 @@ const currentLocalDate: Date = new Date(
8484
currentUtcDate.setMinutes(
8585
currentUtcDate.getMinutes() - currentUtcDate.getTimezoneOffset(),
8686
),
87-
); //currect date in local time zone
87+
); //current date in local time zone
8888
8989
export default defineComponent({
90-
//define component to default values when task is created
90+
//define component to default values when the task is created
9191
data() {
9292
return {
9393
task: "",
94-
dueDate: currentLocalDate.toISOString().split("T")[0], //set default due date to today
95-
priority: Priority.Low, //set default priority is low
96-
difficulty: Difficulty.Easy, //set default difficulty is easy
97-
repeatEvery: 1, //set default task repetition number to 1
98-
repeatInterval: RepeatInterval?.Once, //set default task repetition interval to one-time
94+
dueDate: currentLocalDate.toISOString().split("T")[0], //set the default due date to today
95+
priority: Priority.Low, //set the default priority is low
96+
difficulty: Difficulty.Easy, //set the default difficulty is easy
97+
repeatEvery: 1, //set the default task repetition number to 1
98+
repeatInterval: RepeatInterval?.Once, //set the default task repetition interval to one-time
9999
newId: 0, //initial task id is 0
100100
isCompleted: false, //task not completed if a task is created
101-
timesCompleted: 0, //set default task times completed to 0
102-
streak: 0, //set default task streak to 0
103-
rank: 1, //set default task rank to 1
104-
rankXp: 0, //set default task rank XP to 0
105-
rankProgress: 0, //set default rank progress to 0
106-
originalDueDate: currentLocalDate.toISOString().split("T")[0], //set a default original task due date to today
101+
timesCompleted: 0, //set the default task times completed to 0
102+
streak: 0, //set the default task streak to 0
103+
rank: 1, //set the default task rank to 1
104+
rankXp: 0, //set the default task rank XP to 0
105+
rankProgress: 0, //set the default rank progress to 0
106+
originalDueDate: currentLocalDate.toISOString().split("T")[0], //set the default original task due date to today
107107
};
108108
},
109109
mounted() {

src/store/index.ts

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -25,33 +25,33 @@ export default createStore({
2525
*/
2626
tasks: [] as Task[],
2727
user: {
28-
level: 1 as number, //set level to 1 as total XP is 0 when state is created
29-
xp: 0 as number, //set xp to 0 when state is created
30-
progress: 0 as number, //set level progress to 0 percent when state is created
31-
score: 0 as number, //set score to 0 when state is created
32-
rating: 0 as number, //set rating to 0 when state is created
28+
level: 1 as number, //set the level to 1 as total XP is 0 when state is created
29+
xp: 0 as number, //set the xp to 0 when state is created
30+
progress: 0 as number, //set the level progress to 0 percent when state is created
31+
score: 0 as number, //set the score to 0 when state is created
32+
rating: 0 as number, //set the rating to 0 when state is created
3333
bestScoreEarned: 0 as number, //the highest number of points earned achieved when the task is completed
3434
dailyStreak: 0 as number, //set daily streak to 0 and last completion date to undefined when state is created
3535
tasksCompletedToday: 0 as number, //set the number of tasks completed in a day (today) to 0
3636
totalTasksCompleted: 0 as number, //set the total number of tasks completed to 0
37-
lastCompletionDate: undefined as string | undefined, //last completion date in YYYY-MM-DD string
37+
lastCompletionDate: undefined as string | undefined, //task last completion date in YYYY-MM-DD string
3838
},
3939
},
4040
getters: {
4141
/**
4242
* Getter methods for tasks with tasks and user data.
4343
*/
4444
getTasks: (state) => state.tasks, //get the task list
45-
getXp: (state) => state.user.xp, //get user XP
46-
getLevel: (state) => state.user.level, //get user level
47-
getProgress: (state) => state.user.progress, //get user level progress
48-
getScore: (state) => state.user.score, //get user score
49-
getRating: (state) => state.user.rating, //get user rating
50-
getDailyStreak: (state) => state.user.dailyStreak, //get user daily streak
51-
getTasksCompletedToday: (state) => state.user.tasksCompletedToday, //get user tasks completed in a day
52-
getTotalTasksCompleted: (state) => state.user.totalTasksCompleted, //get user total tasks completed
53-
getLastCompletionDate: (state) => state.user.lastCompletionDate, //get user last completion date
54-
getBestScoreEarned: (state) => state.user.bestScoreEarned, //get the user best score earned when the task is completed
45+
getXp: (state) => state.user.xp, //get the user XP
46+
getLevel: (state) => state.user.level, //get the user level
47+
getProgress: (state) => state.user.progress, //get the user level progress
48+
getScore: (state) => state.user.score, //get the user score
49+
getRating: (state) => state.user.rating, //get the user rating
50+
getDailyStreak: (state) => state.user.dailyStreak, //get the user daily streak
51+
getTasksCompletedToday: (state) => state.user.tasksCompletedToday, //get the user tasks completed in a day
52+
getTotalTasksCompleted: (state) => state.user.totalTasksCompleted, //get the user total tasks completed
53+
getLastCompletionDate: (state) => state.user.lastCompletionDate, //get the user last completion date
54+
getBestScoreEarned: (state) => state.user.bestScoreEarned, //get the user the best score earned when the task is completed
5555
},
5656
mutations: {
5757
/**
@@ -68,7 +68,7 @@ export default createStore({
6868
); //calculate the number of days until the task is due
6969
let dateMultiplier: number;
7070
if (daysToDue < 0) {
71-
//if the task is overdue, XP and score multiplier is less than 1 that decreases over time when the task is overdue
71+
//if the task is overdue, XP and score multiplier are less than 1 that decreases over time when the task is overdue
7272
dateMultiplier = -2 / (daysToDue - 1);
7373
} else if (daysToDue === 0) {
7474
//if the task is due today, XP and score multiplier bonus increases more than 2 based on the time the task is completed
@@ -107,7 +107,7 @@ export default createStore({
107107
let activeTasksMultiplier: number; //calculate score multiplier for number of active tasks (tasks that are not completed)
108108
//calculate task repetition XP multiplier
109109
if (Number(task.repeatInterval) === 1) {
110-
//if task repetition interval is daily
110+
//if the task repetition interval is daily
111111
if (task.repeatEvery < 7) {
112112
//7 days is 1 week
113113
repeatMultiplier = 1 + (task.repeatEvery - 1) / (7 - 1); //1x XP multiplier for daily tasks (1 day) to 2x XP multiplier for weekly tasks (7 days)
@@ -121,7 +121,7 @@ export default createStore({
121121
repeatMultiplier = 5 - 365 / task.repeatEvery; //4x XP multiplier for yearly tasks (approximately 365 days) to 5x XP multiplier for one-time tasks
122122
}
123123
} else if (Number(task.repeatInterval) === 2) {
124-
//if task repetition interval is weekly
124+
//if the task repetition interval is weekly
125125
if (task.repeatEvery < 4) {
126126
//approximately 4 weeks is 1 month
127127
repeatMultiplier = 2 + (task.repeatEvery - 1) / (4 - 1); //2x XP multiplier for weekly tasks (1 week) to 3x XP multiplier for monthly tasks (approximately 4 weeks)
@@ -132,18 +132,18 @@ export default createStore({
132132
repeatMultiplier = 5 - 52 / task.repeatEvery; //4x XP multiplier for yearly tasks (approximately 52 weeks) to 5x XP multiplier for one-time tasks
133133
}
134134
} else if (Number(task.repeatInterval) === 3) {
135-
//if task repetition interval is monthly
135+
//if the task repetition interval is monthly
136136
if (task.repeatEvery < 12) {
137137
//12 months is 1 year
138138
repeatMultiplier = 3 + (task.repeatEvery - 1) / (12 - 1); //3x XP multiplier for monthly tasks (1 month) to 4x XP multiplier for yearly tasks (12 months)
139139
} else {
140140
repeatMultiplier = 5 - 12 / task.repeatEvery; //4x XP multiplier for yearly tasks (12 months) to 5x XP multiplier for one-time tasks
141141
}
142142
} else if (Number(task.repeatInterval) === 4) {
143-
//if task repetition interval is yearly
143+
//if the task repetition interval is yearly
144144
repeatMultiplier = 5 - 1 / task.repeatEvery; //4x XP multiplier for yearly tasks (1 year) to 5x XP multiplier for one-time tasks
145145
} else {
146-
//if task repetition interval is one-time
146+
//if the task repetition interval is one-time
147147
repeatMultiplier = 5; //get 5x XP multiplier for one-time tasks
148148
}
149149
//calculate task streak
@@ -220,7 +220,7 @@ export default createStore({
220220
dailyStreakMultiplier = 9.783; //9.783x daily streak XP multiplier from 3,652 daily streaks (approximately 10 years)
221221
}
222222
const previousCompletionDate: string | undefined =
223-
state.user.lastCompletionDate; //set previous completion date to last completion date
223+
state.user.lastCompletionDate; //set the previous completion date to last completion date
224224
//set the last completion date to today
225225
state.user.lastCompletionDate = new Date(
226226
new Date().setMinutes(
@@ -244,7 +244,7 @@ export default createStore({
244244
(1 + Math.log(Math.max(overdueTasks + 1, 1))),
245245
0,
246246
); //decrease user rating for each day of inactivity
247-
state.user.rating = Math.max(state.user.rating, 0); //make sure rating is not below 0
247+
state.user.rating = Math.max(state.user.rating, 0); //make sure the rating is not below 0
248248
}
249249
}
250250
//calculate task streak XP multiplier
@@ -638,7 +638,7 @@ export default createStore({
638638
),
639639
1,
640640
); //get at least 1 point when the task is completed
641-
state.user.score += pointsEarned; //get amount of points earned based on task difficulty, task priority, task due date, task repetition, task streak, daily streak, user level and rank multipliers
641+
state.user.score += pointsEarned; //get the amount of points earned based on task difficulty, task priority, task due date, task repetition, task streak, daily streak, user level and rank multipliers
642642
if (pointsEarned > state.user.bestScoreEarned) {
643643
//if points earned are greater than the best score earned
644644
state.user.bestScoreEarned = pointsEarned; //set the best score earned to points earned when the task is completed
@@ -700,7 +700,7 @@ export default createStore({
700700
} else {
701701
item.timesCompleted++; //increment number of times tasks has been completed by 1
702702
if (Number(item.repeatInterval) === 1) {
703-
//if task repeat interval is daily
703+
//if the task repeat interval is daily
704704
const newDueDate: Date = new Date(
705705
new Date(item.originalDueDate + " 23:59:59.999").setDate(
706706
new Date(item.originalDueDate + " 23:59:59.999").getDate() +
@@ -714,7 +714,7 @@ export default createStore({
714714
); //convert to local timezone
715715
item.dueDate = adjustedNewDueDate.toISOString().split("T")[0]; //convert due date to YYYY-MM-DD string
716716
} else if (Number(item.repeatInterval) === 2) {
717-
//if task repeat interval is weekly
717+
//if the task repeat interval is weekly
718718
const newDueDate: Date = new Date(
719719
new Date(item.originalDueDate + " 23:59:59.999").setDate(
720720
new Date(item.originalDueDate + " 23:59:59.999").getDate() +
@@ -728,7 +728,7 @@ export default createStore({
728728
);
729729
item.dueDate = adjustedNewDueDate.toISOString().split("T")[0];
730730
} else if (Number(item.repeatInterval) === 3) {
731-
//if task repeat interval is monthly
731+
//if the task repeat interval is monthly
732732
const monthsAfter: Date = new Date(
733733
new Date(item.originalDueDate + " 23:59:59.999").setMonth(
734734
new Date(item.originalDueDate + " 23:59:59.999").getMonth() +
@@ -778,7 +778,7 @@ export default createStore({
778778
item.dueDate = adjustedNewDueDate.toISOString().split("T")[0];
779779
}
780780
} else if (Number(item.repeatInterval) === 4) {
781-
//if task repeat interval is yearly
781+
//if the task repeat interval is yearly
782782
const yearsAfter: Date = new Date(
783783
new Date(item.originalDueDate + " 23:59:59.999").setFullYear(
784784
new Date(item.originalDueDate + " 23:59:59.999").getFullYear() +

0 commit comments

Comments
 (0)