Skip to content

Commit

Permalink
レンダリングの時だけ日付をフォーマットする
Browse files Browse the repository at this point in the history
  • Loading branch information
kphrx committed Dec 27, 2021
1 parent 267bc5c commit 413ca6f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/lib/src/nico/VideoInfoLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ const VideoInfoLoader = (function () {
title_original: data.video.originalTitle,
description: data.video.description,
description_original: data.video.originalDescription,
postedAt: new Date(data.video.registeredAt).toLocaleString(),
postedAt: data.video.registeredAt,
thumbnail: data.video.thumbnail.url,
largeThumbnail: data.video.thumbnail.player,
length: data.video.duration,
Expand Down
2 changes: 1 addition & 1 deletion packages/zenza/src/Playlist/VideoListItemView.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ class VideoListItemView {
<span class="command pocket-info" data-command="pocket-info" data-param=${watchId} title="動画情報"></span>
</div>
<div class="videoInfo">
<div class="postedAt">${item.postedAt}</div>
<div class="postedAt">${new Date(item.postedAt).toLocaleString()}</div>
<div class="title">
<a class="command videoLink"
href=${watchUrl} data-command="select" data-param=${itemId} title=${title}>${title}</a>
Expand Down
2 changes: 1 addition & 1 deletion src/VideoInfoPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -2857,7 +2857,7 @@ class VideoMetaInfo extends BaseViewComponent {
}

update(videoInfo) {
this._elm.postedAt.textContent = videoInfo.postedAt;
this._elm.postedAt.textContent = new Date(videoInfo.postedAt).toLocaleString();
const count = videoInfo.count;
this.updateVideoCount(count);
}
Expand Down

0 comments on commit 413ca6f

Please sign in to comment.