mirror of
https://github.com/zadam/trilium.git
synced 2025-10-28 08:46:43 +01:00
note revision widget displays only date and time, no time offset
This commit is contained in:
@@ -36,7 +36,6 @@ const RELATION_DEFINITION = 'relation-definition';
|
||||
|
||||
/**
|
||||
* This note's representation is used in note tree and is kept in TreeCache.
|
||||
* Its notable omission is the note content.
|
||||
*/
|
||||
class NoteShort {
|
||||
constructor(treeCache, row) {
|
||||
@@ -53,6 +52,7 @@ class NoteShort {
|
||||
this.mime = row.mime;
|
||||
/** @param {boolean} */
|
||||
this.archived = row.archived;
|
||||
/** @param {string} */
|
||||
this.cssClass = row.cssClass;
|
||||
}
|
||||
|
||||
@@ -61,6 +61,26 @@ class NoteShort {
|
||||
return this.mime === "application/json";
|
||||
}
|
||||
|
||||
async getContent() {
|
||||
// we're not caching content since these objects are in treeCache and as such pretty long lived
|
||||
const note = await server.get("notes/" + this.noteId);
|
||||
|
||||
return note.content;
|
||||
}
|
||||
|
||||
async getJsonContent() {
|
||||
const content = await this.getContent();
|
||||
|
||||
try {
|
||||
return JSON.parse(content);
|
||||
}
|
||||
catch (e) {
|
||||
console.log(`Cannot parse content of note ${this.noteId}: `, e.message);
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/** @returns {Promise<Branch[]>} */
|
||||
async getBranches() {
|
||||
const branchIds = this.treeCache.parents[this.noteId].map(
|
||||
|
||||
Reference in New Issue
Block a user