mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
feat(tasks): display due date without time
This commit is contained in:
parent
d73c9308a9
commit
d0c703515b
@ -6,6 +6,7 @@ import * as taskService from "../../services/tasks.js";
|
|||||||
import type { EventData } from "../../components/app_context.js";
|
import type { EventData } from "../../components/app_context.js";
|
||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import calendarTime from "dayjs/plugin/calendar.js";
|
import calendarTime from "dayjs/plugin/calendar.js";
|
||||||
|
import { t } from "../../services/i18n.js";
|
||||||
dayjs.extend(calendarTime);
|
dayjs.extend(calendarTime);
|
||||||
|
|
||||||
const TPL = `
|
const TPL = `
|
||||||
@ -81,6 +82,7 @@ function buildTasks(tasks: FTask[]) {
|
|||||||
let html = '';
|
let html = '';
|
||||||
|
|
||||||
const now = dayjs();
|
const now = dayjs();
|
||||||
|
const dateFormat = "DD-MM-YYYY";
|
||||||
for (const task of tasks) {
|
for (const task of tasks) {
|
||||||
const classes = ["task"];
|
const classes = ["task"];
|
||||||
|
|
||||||
@ -94,7 +96,14 @@ function buildTasks(tasks: FTask[]) {
|
|||||||
if (task.dueDate) {
|
if (task.dueDate) {
|
||||||
html += `<span class="due-date">`;
|
html += `<span class="due-date">`;
|
||||||
html += `<span class="bx bx-calendar"></span> `;
|
html += `<span class="bx bx-calendar"></span> `;
|
||||||
html += dayjs(task.dueDate).calendar();
|
html += dayjs(task.dueDate).calendar(null, {
|
||||||
|
sameDay: `[${t("tasks.due.today")}]`,
|
||||||
|
nextDay: `[${t("tasks.due.tomorrow")}]`,
|
||||||
|
nextWeek: "dddd",
|
||||||
|
lastDay: `[${t("tasks.due.yesterday")}]`,
|
||||||
|
lastWeek: dateFormat,
|
||||||
|
sameElse: dateFormat
|
||||||
|
});
|
||||||
html += "</span>";
|
html += "</span>";
|
||||||
}
|
}
|
||||||
html += `<div class="edit-container"></div>`;
|
html += `<div class="edit-container"></div>`;
|
||||||
|
@ -1675,5 +1675,12 @@
|
|||||||
"time_selector": {
|
"time_selector": {
|
||||||
"invalid_input": "The entered time value is not a valid number.",
|
"invalid_input": "The entered time value is not a valid number.",
|
||||||
"minimum_input": "The entered time value needs to be at least {{minimumSeconds}} seconds."
|
"minimum_input": "The entered time value needs to be at least {{minimumSeconds}} seconds."
|
||||||
|
},
|
||||||
|
"tasks": {
|
||||||
|
"due": {
|
||||||
|
"today": "Today",
|
||||||
|
"tomorrow": "Tomorrow",
|
||||||
|
"yesterday": "Yesterday"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1678,5 +1678,12 @@
|
|||||||
"redirect_bare_domain_description": "Redirecționează utilizatorii anonimi către pagina de partajare în locul paginii de autentificare",
|
"redirect_bare_domain_description": "Redirecționează utilizatorii anonimi către pagina de partajare în locul paginii de autentificare",
|
||||||
"redirect_bare_domain": "Redirecționează domeniul principal la pagina de partajare",
|
"redirect_bare_domain": "Redirecționează domeniul principal la pagina de partajare",
|
||||||
"check_share_root": "Verificare stare pagină partajată principală"
|
"check_share_root": "Verificare stare pagină partajată principală"
|
||||||
|
},
|
||||||
|
"tasks": {
|
||||||
|
"due": {
|
||||||
|
"today": "Azi",
|
||||||
|
"tomorrow": "Mâine",
|
||||||
|
"yesterday": "Ieri"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user