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

Fixed note order in RN

This commit is contained in:
Laurent Cozic
2017-07-15 19:13:31 +01:00
parent 62c9a66c47
commit 93791f1e46
6 changed files with 56 additions and 3 deletions

View File

@ -58,6 +58,15 @@ class Note extends BaseItem {
return output;
}
static sortNotes(notes, order) {
return notes.sort((a, b) => {
let r = -1;
if (a[order.orderBy] < b[order.orderBy]) r = +1;
if (order.orderByDir == 'ASC') r = -r;
return r;
});
}
static previewFields() {
return ['id', 'title', 'body', 'is_todo', 'todo_completed', 'parent_id', 'updated_time', 'sync_time'];
}