Skip to content

Commit

Permalink
perf: 稿件页显示当地时间
Browse files Browse the repository at this point in the history
  • Loading branch information
RockChinQ committed Jul 5, 2024
1 parent 1abc47c commit 2eac239
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend/src/pages/world.vue
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export default {
for (let i = 0; i < p.length; i++) {
// 2024-04-12T08:19:51.096Z 转成日期,再转成字符串
let date = new Date(p[i].created_at)
p[i].created_at = date.getUTCFullYear() + "-" + (date.getUTCMonth() + 1) + "-" + date.getUTCDate() + " " + date.getUTCHours() + ":" + date.getUTCMinutes() + ":" + date.getUTCSeconds()
p[i].created_at = date.toLocaleString()
p[i].status = this.$store.state.statusMap[p[i].status]
for (let j = 0; j < p[i].images.length; j++) {
p[i].images[j] = this.$store.state.base_url + "/v1/post/download-image/" + p[i].images[j]
Expand Down Expand Up @@ -322,7 +322,7 @@ export default {
for (let i = 0; i < p.length; i++) {
// 2024-04-12T08:19:51.096Z 转成日期,再转成字符串,转成 YYYY-MM-DD HH:MM:SS UTC+8
let date = new Date(p[i].created_at)
p[i].created_at = date.getUTCFullYear() + "-" + (date.getUTCMonth() + 1) + "-" + date.getUTCDate() + " " + date.getUTCHours() + ":" + date.getUTCMinutes() + ":" + date.getUTCSeconds()
p[i].created_at = date.toLocaleString()
p[i].status = this.$store.state.statusMap[p[i].status]
for (let j = 0; j < p[i].images.length; j++) {
p[i].images[j] = this.$store.state.base_url + "/v1/post/download-image/" + p[i].images[j]
Expand Down

0 comments on commit 2eac239

Please sign in to comment.