show timestamps in local time

This commit is contained in:
2025-05-28 00:16:37 +03:00
parent 873a4c0c15
commit 8ea9afd39d
7 changed files with 23 additions and 11 deletions

View File

@ -22,9 +22,9 @@
%>
<a href="<%= post_url %>" title="Permalink"><i>
<% if tonumber(post.edited_at) > tonumber(post.created_at) then -%>
Edited at <%= os.date("%c", post.edited_at) %>
Edited at <% render("views.common.timestamp", {timestamp = post.edited_at}) -%>
<% else -%>
Posted on <%= os.date("%c", post.created_at) %>
Posted on <% render("views.common.timestamp", {timestamp = post.created_at}) -%>
<% end -%>
</i></a>
<span>
@ -47,8 +47,8 @@
end
if show_reply then
local d = post.created_at < post.edited_at and post.edited_at or post.created_at
local quote_src_text = ("On [url=%s]%s[/url], [url=%s]%s[/url] said:"):format(
post_url, os.date("%c", d), url_for("user", {username = post.username}), post.username
local quote_src_text = ("[url=%s]%s said:[/url]"):format(
post_url, post.username
)
local reply_text = ("%s\n[quote]%s[/quote]\n---\n\n"):format(quote_src_text, post.original_markup)
%>