TorrentGeneralInfo: add "Last Activity" field

This commit is contained in:
Jesse Chan
2021-05-26 22:37:02 +08:00
parent 59a3fc74fd
commit 8c04bf245c
2 changed files with 27 additions and 1 deletions
@@ -132,6 +132,30 @@ const TorrentGeneralInfo: FC = observer(() => {
/>
</td>
</tr>
<tr className="torrent-details__detail torrent-details__detail--dateActive">
<td className="torrent-details__detail__label">
<Trans id="torrents.details.general.date.active" />
</td>
<td className="torrent-details__detail__value">
{(() => {
if (torrent.dateActive === 0) {
return VALUE_NOT_AVAILABLE;
}
if (torrent.dateActive === -1) {
return i18n._('torrents.details.general.date.active.now');
}
return i18n.date(new Date(torrent.dateActive * 1000), {
year: 'numeric',
month: 'long',
day: '2-digit',
hour: 'numeric',
minute: 'numeric',
});
})()}
</td>
</tr>
<tr className="torrent-details__table__heading">
<td className="torrent-details__table__heading--tertiary" colSpan={2}>
<Trans id="torrents.details.general.heading.torrent" />
+3 -1
View File
@@ -278,6 +278,8 @@
"torrents.details.files.loading": "Loading file detail...",
"torrents.details.general.comment": "Comment",
"torrents.details.general.connected": "{connected} connected of {total}",
"torrents.details.general.date.active": "Last Activity",
"torrents.details.general.date.active.now": "Now",
"torrents.details.general.date.added": "Added",
"torrents.details.general.date.created": "Created",
"torrents.details.general.date.finished": "Finished",
@@ -386,4 +388,4 @@
"unit.time.second": "s",
"unit.time.week": "wk",
"unit.time.year": "yr"
}
}