diff --git a/src/utils/comments/waline-api.ts b/src/utils/comments/waline-api.ts index 6e3b3c98..34db439b 100644 --- a/src/utils/comments/waline-api.ts +++ b/src/utils/comments/waline-api.ts @@ -111,7 +111,10 @@ export class WalineComments { } mapComment(comment: WalineComment): RecentComments { - const createdAt = formatTime(this.convertDateFormat(comment.insertedAt)) + // slice off the last 5 character to remove the timezone. + const createdAt = formatTime( + new Date(comment.time).toISOString().slice(0, -5) + ) return { id: comment.objectId, body: filterHTMLContent(comment.comment), diff --git a/src/utils/index.ts b/src/utils/index.ts index 134edda3..ff28109f 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -125,7 +125,6 @@ export function filterHTMLContent(content: string, length?: number): string { export function getDaysTillNow(from: string) { const today = new Date() const fromDate = new Date(from) - console.log(fromDate) // To calculate the time difference of two dates const timeDiff = today.getTime() - fromDate.getTime()