mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-28 16:01:32 +08:00
feat(tasks): display due date in calendar-relative format
This commit is contained in:
parent
7bc9114976
commit
5838ac3bca
@ -4,7 +4,9 @@ import froca from "../../services/froca.js";
|
||||
import TypeWidget from "./type_widget.js";
|
||||
import * as taskService from "../../services/tasks.js";
|
||||
import type { EventData } from "../../components/app_context.js";
|
||||
import { html } from "cheerio";
|
||||
import dayjs from "dayjs";
|
||||
import calendarTime from "dayjs/plugin/calendar.js";
|
||||
dayjs.extend(calendarTime);
|
||||
|
||||
const TPL = `
|
||||
<div class="note-detail-task-list note-detail-printable">
|
||||
@ -81,7 +83,7 @@ function buildTasks(tasks: FTask[]) {
|
||||
if (task.dueDate) {
|
||||
html += `<span class="due-date">`;
|
||||
html += `<span class="bx bx-calendar"></span> `;
|
||||
html += task.dueDate;
|
||||
html += dayjs(task.dueDate).calendar();
|
||||
html += "</span>";
|
||||
}
|
||||
html += `<div class="edit-container"></div>`;
|
||||
|
Loading…
x
Reference in New Issue
Block a user