Skip to content

Commit

Permalink
♻️ Allow date to be number (e.g., 2022)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary authored Nov 23, 2022
1 parent 5bc963f commit e696f1f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ const parseNoteFile = async (dirName: string, year: string, file: string): Promi

const date: Date =
"date" in attributes && typeof attributes.date === "string"
? new Date(attributes.date)
: "date" in attributes && typeof attributes.date === "number"
? new Date(attributes.date)
: "date" in attributes && attributes.date instanceof Date
? attributes.date
Expand Down

0 comments on commit e696f1f

Please sign in to comment.