Skip to content

Commit 6be8a97

Browse files
committed
fix: sort history
1 parent 0b233d1 commit 6be8a97

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ Add `history` field to page front-matter.
3232
```md
3333
---
3434
history:
35-
- date: 2023-10-15 <!-- recommended YYYY-MM-DD -->
36-
message: Add **awesome section**.
35+
- date: 2023-10-15 # recommended YYYY-MM-DD
36+
message: |
37+
Add **awesome section**.
3738
- date: 2023-10-10
38-
message: Initial release
39+
message: |
40+
Initial release
3941
---
4042

4143
## Page Title

src/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export const parseHistory = (input) => {
6262
input
6363
.filter((item) => typeof item === "object" && item !== null)
6464
// 日付を大きい順に並び替える
65-
.sort((x, y) => {
65+
.sort(({ date: x }, { date: y }) => {
6666
if (x instanceof Date) {
6767
if (y instanceof Date) {
6868
return y - x > 0 ? 1 : -1;

0 commit comments

Comments
 (0)