1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-12 22:57:38 +02:00

All: Allow sorting notes by various fields

This commit is contained in:
Laurent Cozic
2018-02-22 18:58:15 +00:00
parent 74d255c056
commit 8a96cf3434
13 changed files with 252 additions and 51 deletions

View File

@ -15,6 +15,16 @@ class Note extends BaseItem {
return 'notes';
}
static fieldToLabel(field) {
const fieldsToLabels = {
title: 'title',
user_updated_time: 'updated date',
user_created_time: 'created date',
};
return field in fieldsToLabels ? fieldsToLabels[field] : field;
}
static async serialize(note, type = null, shownKeys = null) {
let fieldNames = this.fieldNames();
fieldNames.push('type_');