Skip to content

Commit

Permalink
fix date sort
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinxft committed Aug 9, 2024
1 parent 1e8ebb2 commit 5978717
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ type Data = {
function generateAsciiTable(data: Data) {
// 将数据按日期排序
const sortedDates = Object.keys(data).sort(
(a, b) => new Date(a).getTime() - new Date(b).getTime()
(a, b) => new Date(b).getTime() - new Date(a).getTime()
);

// 生成表格
Expand Down

0 comments on commit 5978717

Please sign in to comment.