Skip to content

Commit

Permalink
Remove fractional seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
vinnie4k committed Nov 19, 2024
1 parent 11a9781 commit a44800b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/posts/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ import {
versionKey: false,
transform: function (doc, ret) {
delete ret._id;
// Remove the fractional seconds
if (ret.time) {
ret.time = ret.time.toISOString().split(".")[0] + "Z";
}
},
},
timestamps: {
Expand Down

0 comments on commit a44800b

Please sign in to comment.