Commit 4a09441f authored by ransome1's avatar ransome1
Browse files

Fixed non-strict recurrences, fixed duplicated todos, optimized css

parent b56905b3
......@@ -544,6 +544,9 @@ nav ul:nth-child(2) {
cursor: pointer;
color: #4a4a4a;
}
#todoTable .flex-table .flex-row.text .categories {
margin-right: 0.5em;
}
#todoTable .flex-table .flex-row.text .button {
font-size: 1.1em;
font-family: FreeSansBold;
......@@ -588,19 +591,16 @@ nav ul:nth-child(2) {
background: #f1d6f1;
}
#todoTable .flex-table .flex-row.itemDueDate {
display: inline;
color: #4a4a4a;
position: relative;
white-space: nowrap;
margin: 0 0.25em;
padding: 1em 0;
text-align: center;
margin: 0 0.25em 0 0;
text-transform: lowercase;
}
#todoTable .flex-table .flex-row.itemDueDate .fa-sort-down {
position: absolute;
right: 0.2em;
bottom: 2.75em;
bottom: 2.25em;
display: none;
}
#todoTable .flex-table .flex-row.itemDueDate .tags {
......@@ -626,10 +626,6 @@ nav ul:nth-child(2) {
background: #ff3860;
font-family: FreeSansBold;
}
#todoTable .flex-table .flex-row.isToday svg,
#todoTable .flex-table .flex-row.isToday .button svg {
color: inherit;
}
#todoTable .flex-table .flex-row.isTomorrow,
#todoTable .flex-table .flex-row.isTomorrow .button {
color: #fa745e;
......
This diff is collapsed.
......@@ -38,6 +38,7 @@ function generateRecurrence(todo) {
recurringTodo.completed = null;
// if the item to be duplicated has been completed before the due date, the recurring item needs to be set incomplete again
recurringTodo.date = new Date;
// if todo has no due date, the recurrence time frame will be added to the date of completion
recurringTodo.due = getRecurrenceDate(todo.due, todo.rec);
recurringTodo.dueString = convertDate(recurringTodo.due);
// get index of recurring todo
......@@ -58,7 +59,7 @@ function generateRecurrence(todo) {
}
function getRecurrenceDate(due, recurrence) {
let recSplit = splitRecurrence(recurrence);
if (!recSplit.plus) {
if (!recSplit.plus || !due) {
// no plus in recurrence expression, so do the default "non-strict" recurrence.
// (Otherwise we will use the previous due date, for strict recurrence.)
due = new Date(); // use today's date as base for recurrence
......
......@@ -164,7 +164,6 @@ function generateGroups(items) {
items.forEach((group) => {
group[1] = sortTodoData(group[1]);
});
return Promise.resolve(items)
}
function generateTable(groups, append) {
......@@ -197,17 +196,15 @@ function generateTable(groups, append) {
dividerRow = document.createRange().createContextualFragment("<div id=\"" + userData.sortBy + groups[group][0] + "\" class=\"flex-table group due\" role=\"rowgroup\"><div class=\"flex-row\" role=\"cell\"><span class=\"button\">" + groups[group][0] + "</span></div></div>")
}
// create an empty divider row
} /*else {
} else {
dividerRow = document.createRange().createContextualFragment("<div class=\"flex-table group\" role=\"rowgroup\"><div class=\"flex-row\" role=\"cell\"></div></div>")
}*/
}
// add divider row only if it doesn't exist yet
if(!document.getElementById(userData.sortBy + groups[group][0]) && dividerRow) tableContainerContent.appendChild(dividerRow);
if(!append && !document.getElementById(userData.sortBy + groups[group][0]) && dividerRow) tableContainerContent.appendChild(dividerRow);
for (let item in groups[group][1]) {
let todo = groups[group][1][item];
// if this todo is not a recurring one the rec value will be set to null
if(!todo.rec) {
todo.rec = null;
}
if(!todo.rec) todo.rec = null;
// incompleted todos with due date
if (todo.due && !todo.complete) {
// create notification
......
......@@ -974,10 +974,10 @@ async function startBuilding(searchString, append) {
const groups = await todos.generateGroups(todos.items.filtered);
await todos.generateTable(groups, append);
userData = await getUserData();
await todos.generateTable(groups, append);
configureMainView();
showResultStats();
......
......@@ -514,6 +514,9 @@ nav {
line-height: 1.7em;
cursor: pointer;
color: $dark-grey;
.categories {
margin-right: .5em;
}
.button {
font-size: 1.1em;
font-family: FreeSansBold;
......@@ -558,20 +561,16 @@ nav {
.flex-row .projects {
background: $sleek-projects-button;
}
.flex-row.itemDueDate {
display: inline;
color: $dark-grey;
position: relative;
white-space: nowrap;
margin: 0 .25em;
padding: 1em 0;
text-align: center;
margin: 0 .25em 0 0;
text-transform: lowercase;
.fa-sort-down {
position: absolute;
right: .2em;
bottom: 2.75em;
right: 0.2em;
bottom: 2.25em;
display: none;
}
.tags {
......@@ -596,9 +595,6 @@ nav {
background: $has-text-danger;
font-family: FreeSansBold;
}
svg {
color: inherit;
}
}
.flex-row.isTomorrow,
.flex-row.isTomorrow .button {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment