sort files by date in list code example
Example 1: sort array by date
const sortedActivities = activities.sort((a, b) => b.date - a.date)
Example 2: git ls files sort by date
git log HEAD --pretty="/invert:%h" --name-only | grep -v -E "^\/invert:|^$" | sort -u | while read path;do echo $(git log -1 --pretty="%ad %h" --date=format:"%Y-%m-%d %H:%M:%S" -- "$path") $path;done | sort -u