Skip to content

Commit

Permalink
Merge pull request #274 from cybozu/fix/timeline-ui-sort
Browse files Browse the repository at this point in the history
月でsortするように
  • Loading branch information
nakajmg authored Dec 21, 2023
2 parents 72e03e6 + 3e08328 commit 2c99336
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/pages/lookback/[slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ const createTopicsByMonth = (topics: Topic[]): TopicByMonth[] => {
topicsByMonth[monthIndex].topics.push(topic)
}
})
return topicsByMonth
return topicsByMonth.sort((a, b) => {
if (a.month > b.month) return 1
if (a.month < b.month) return -1
return 0
})
}
const sortByDate = (topics: TopicByMonth[]): TopicByMonth[] => {
Expand Down

0 comments on commit 2c99336

Please sign in to comment.