updated mock dream dates with randomized range generator, adjusted imports for consistency, and relocated utilities for better structure

Signed-off-by: Matthias Puchstein <matthias@puchstein.bayern>
This commit is contained in:
2025-07-09 23:46:16 +02:00
parent bb1d778600
commit 846822ed41
4 changed files with 23 additions and 15 deletions

10
src/utils/DreamUtils.ts Normal file
View File

@@ -0,0 +1,10 @@
import Dream from '../types/Dream.ts';
/**
* Sorts dreams by date in descending order (newest first)
* @param dreams - Array of dreams to sort
* @returns Sorted array of dreams
*/
export const getSortedDreamsByDate = (dreams: Dream[]): Dream[] => {
return [...dreams].sort((a, b) => b.date.getTime() - a.date.getTime());
};