Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
[Bug] Post time is set using the incorrect time zone #48
Browse files Browse the repository at this point in the history
  • Loading branch information
langningc2009 committed Aug 25, 2023
1 parent aa58f8a commit 8300f54
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions XMOJ.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -2984,7 +2984,7 @@ else {
<td><a href="/discuss3/thread.php?tid=${Posts[i].PostID}">${Posts[i].Title}</a></td>
<td><a class="${await GetUsernameColorClass(Posts[i].UserID)}" href="/userinfo.php?user=${Posts[i].UserID}">${Posts[i].UserID}</a></td>` +
(Posts[i].ProblemID == 0 ? `<td></td>` : `<td><a href="/problem.php?id=${Posts[i].ProblemID}">${Posts[i].ProblemID}</a></td>`) +
`<td>${Posts[i].PostTime}</td>
`<td>${new Date(Posts[i].PostTime + 1000 * 60 * 60 * 8).toLocaleString()}</td>
<td>${Posts[i].ReplyCount}</td>
<td><a class="${await GetUsernameColorClass(Posts[i].LastReplyUserID)}" href="/userinfo.php?user=${Posts[i].LastReplyUserID}">${Posts[i].LastReplyUserID}</a> ${Posts[i].LastReplyTime}</td>
</tr>`;
Expand Down Expand Up @@ -3179,7 +3179,7 @@ else {
PostAuthor.innerHTML = ResponseData.Data.UserID;
PostAuthor.classList.add(await GetUsernameColorClass(ResponseData.Data.UserID));
PostAuthor.href = "/userinfo.php?user=" + ResponseData.Data.UserID;
PostTime.innerText = ResponseData.Data.PostTime;
PostTime.innerText = new Date(ResponseData.Data.PostTime + 1000 * 60 * 60 * 8).toLocaleString();
let Replies = ResponseData.Data.Reply;
PostReplies.innerHTML = "";
for (let i = 0; i < Replies.length; i++) {
Expand All @@ -3201,7 +3201,7 @@ else {
CardBodyRowSpan2Element.className = "col-4 text-muted";
CardBodyRowSpan2Element.innerText = "发布时间:";
let CardBodyRowSpan2SpanElement = document.createElement("span");
CardBodyRowSpan2SpanElement.innerText = Replies[i].ReplyTime;
CardBodyRowSpan2SpanElement.innerText = new Date(Replies[i].ReplyTime + 1000 * 60 * 60 * 8).toLocaleString();
CardBodyRowSpan2Element.appendChild(CardBodyRowSpan2SpanElement);
let CardBodyRowSpan3Element = document.createElement("span");
CardBodyRowSpan3Element.className = "col-4";
Expand Down

0 comments on commit 8300f54

Please sign in to comment.