Skip to content

Commit

Permalink
rephrase main page card due description
Browse files Browse the repository at this point in the history
  • Loading branch information
HectorVilas committed Jan 18, 2023
1 parent d58f96f commit a2c4092
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/modules/ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -976,9 +976,14 @@ export const ui = (() => {
todos.innerText = `Number of to-dos: ${project.todosLength}`;

const expiring = document.createElement("p");
const dueDateFormat = project.expiring.todoDue.split("-").join(",");
expiring.classList.add("main-page-due");
expiring.innerText = project.expiring.todoTitle == undefined ? ""
: `The to-do "${project.expiring.todoTitle}" with ${project.expiring.tasksLength} tasks will expire on ${project.expiring.todoDue}`;
: `"${project.expiring.todoTitle
}" is the pending to-do closest to due date, with ${
project.expiring.tasksLength} tasks on it.
Will expire ${ intlFormatDistance(new Date(dueDateFormat), new Date())
} (${project.expiring.todoDue}).`;


card.append(projectTitle, todos, expiring);
Expand Down

0 comments on commit a2c4092

Please sign in to comment.