fix(journals): robust date sorting in journal and entry processors
This commit is contained in:
@@ -1027,15 +1027,16 @@ export async function process_ae_obj__journal_entry_props({
|
||||
|
||||
// Journal entry-specific computed sort fields, overriding generic ones if needed
|
||||
const sort_val = (obj.sort ?? 0).toString().padStart(3, '0');
|
||||
const updated = obj.updated_on ?? obj.created_on ?? new Date(0).toISOString();
|
||||
obj.tmp_sort_1 = `${obj.group ?? ''}_${obj.priority ? '1' : '0'}_${
|
||||
sort_val
|
||||
}_${obj.updated_on ?? obj.created_on}`;
|
||||
}_${updated}`;
|
||||
obj.tmp_sort_2 = `${obj.group ?? ''}_${obj.priority ? '1' : '0'}_${
|
||||
sort_val
|
||||
}_${obj.name ?? ''}_${obj.updated_on ?? obj.created_on}`;
|
||||
}_${obj.name ?? ''}_${updated}`;
|
||||
obj.tmp_sort_3 = `${obj.group ?? ''}_${obj.priority ? '1' : '0'}_${
|
||||
sort_val
|
||||
}_${obj.name ?? ''}_${obj.updated_on ?? obj.created_on}`;
|
||||
}_${obj.name ?? ''}_${updated}`;
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user