JacobEvelyn/friends

Newer activities should always appear above older activities on the same date

JacobEvelyn opened this issue · 0 comments

When we write the friends.md file we sort the activities using Ruby's built-in Enumerable#sort method. However, this sort is not stable, meaning that two activities on the same date can rearrange themselves nondeterministically each time the file is rewritten. This leads to situations like (assuming the activities were added in the order in which they occurred):

### Activities:
- 2018-01-01: After breakfast, **Marie Curie** and I walked around _Paris_ together.
- 2018-01-01: First, **Marie Curie** and I started off the new year by getting breakfast together.
- 2018-01-01: After walking around for a while, **Marie Curie** and I said our goodbyes and parted ways.

And re-running friends clean (or any command that writes anything to the file) can rearrange these activities into any other order at any time. This can become confusing when many events occurred on the same day.