fix(journals): robust date sorting in journal and entry processors

This commit is contained in:
Scott Idem
2026-02-12 15:23:22 -05:00
parent c4009391c0
commit 60771c5ba1
2 changed files with 7 additions and 5 deletions

View File

@@ -205,7 +205,7 @@ export async function load_ae_obj_li__journal({
hidden?: 'hidden' | 'all' | 'not_hidden' | undefined; // all, hidden, not_hidden
limit?: number;
offset?: number;
order_by_li?: key_val;
order_by_li?: key_val; // Order by fields for the journal entries
params?: key_val;
try_cache?: boolean;
log_lvl?: number;
@@ -859,9 +859,10 @@ export async function process_ae_obj__journal_props({
obj.cfg_json = obj.cfg_json ?? {};
obj.data_json = obj.data_json ?? {};
const updated = obj.updated_on ?? obj.created_on ?? new Date(0).toISOString();
obj.tmp_sort_3 = `${obj.group ?? '0'}_${obj.priority ? 1 : 0}_${obj.sort ?? '0'}_${
obj.name
}_${obj.updated_on ?? obj.created_on}`;
}_${updated}`;
obj.combined_passcode = `${obj.passcode ?? ''}:${obj.private_passcode ?? ''}`;
return obj;