#317 last_status type

This commit is contained in:
cutls 2020-08-05 12:38:51 +09:00
parent 80ce93785a
commit 31cc929c68
2 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,9 @@
//日付パーサー
function date(str, datetype) {
if (datetype == "relative") {
function date(str, datetype, lastStatus) {
if (lastStatus) {
var date = new Date(str)
return date.getFullYear() + "/" + (date.getMonth() + 1) + "/" + date.getDate()
} else if (datetype == "relative") {
return '<time class="timeago" datetime="' + str + '"></time>'
} else {
var date = new Date(str)

View File

@ -1319,7 +1319,7 @@ function userparse(obj, auth, acct_id, tlid, popup) {
} else {
var udg = `<a onclick="udg('${toot.id}','${acct_id}');" user="${toot.acct}" class="udg">`
}
var latest = date(toot.last_status_at, 'relative')
var latest = date(toot.last_status_at, 'relative', true)
if (toot.last_status_at) {
var latesthtml = `<div class="cbadge" style="width:100px;">Last <span class="voice">toot</span>: ${latest}</div>`
} else {