FIX commit time format

This commit is contained in:
Jasder 2020-05-22 16:50:33 +08:00
parent 212d8f8f60
commit 5d3505ec7c
1 changed files with 11 additions and 1 deletions

View File

@ -26,5 +26,15 @@ json.array! @entries do |entry|
json.content entry['content']
json.target entry['target']
end
json.commit entry['latest_commit']
if entry['latest_commit']
created_at = Time.at(entry['latest_commit']['created_at'].to_i).strftime("%Y-%m-%d %H:%M")
json.commit do
json.message entry['latest_commit']['message']
json.sha entry['latest_commit']['sha']
json.created_at fix_time entry['latest_commit']
json.time_from_now time_from_now(created_at)
json.created_at_unix entry['latest_commit']['created_at']
end
end
end