fixed autocomplete

This commit is contained in:
azivner
2017-11-19 19:39:39 -05:00
parent e992087720
commit 658f4872af
6 changed files with 49 additions and 29 deletions

View File

@@ -20,25 +20,6 @@ function showError(str) {
error.fadeOut(10000);
}
function getAutocompleteItems(noteIds) {
const autocompleteItems = [];
for (const noteId of noteIds) {
const fullName = treeUtils.getFullName(noteId);
if (fullName !== null) {
autocompleteItems.push({
value: fullName + " (" + noteId + ")",
label: fullName
});
}
}
autocompleteItems.sort((a, b) => a.value < b.value ? -1 : 1);
return autocompleteItems;
}
function getDateFromTS(timestamp) {
// Date accepts number of milliseconds since epoch so UTC timestamp works without any extra handling
// see https://stackoverflow.com/questions/4631928/convert-utc-epoch-to-local-date-with-javascript