@pschroee/redmine-mcp 0.5.5 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -211,8 +211,10 @@ export function formatJournals(journals, lookup = {}, options = {}) {
|
|
|
211
211
|
return "";
|
|
212
212
|
}
|
|
213
213
|
const header = `## History (${journals.length} entries)\n\n`;
|
|
214
|
+
// Sort journals chronologically (oldest first) to ensure correct numbering
|
|
215
|
+
const sortedJournals = [...journals].sort((a, b) => new Date(a.created_on).getTime() - new Date(b.created_on).getTime());
|
|
214
216
|
// Format entries with correct note numbers (1 = oldest), then reverse for display (newest first)
|
|
215
|
-
const formattedEntries =
|
|
217
|
+
const formattedEntries = sortedJournals.map((j, i) => formatJournalEntry(j, i + 1, lookup, options));
|
|
216
218
|
const entries = formattedEntries.reverse().join("\n---\n\n");
|
|
217
219
|
return header + entries;
|
|
218
220
|
}
|