Use config timezone in all displayed times (#326)

This commit is contained in:
Nixinova
2021-05-27 04:19:24 +12:00
committed by GitHub
parent 67712cd07a
commit 19552e2dc5
8 changed files with 11 additions and 11 deletions

View File

@@ -251,7 +251,7 @@
</h2> </h2>
<ul v-if="activity.length"> <ul v-if="activity.length">
<li v-for="{actor, type, repo, timestamp, ...event} of activity"> <li v-for="{actor, type, repo, timestamp, ...event} of activity">
<time :datetime="timestamp">{{ format("date", timestamp, {timeStyle:"short", dateStyle:"short"}) }}</time> <time :datetime="timestamp">{{ format("date", timestamp, {timeStyle:"short", dateStyle:"short", timeZone:config.timezone?.name}) }}</time>
<div class="actor" v-if="account.type === 'organization'"> <div class="actor" v-if="account.type === 'organization'">
<img :src="`https://github.com/${/\[bot\]$/.test(actor) ? 'actions' : actor }.png`"> <img :src="`https://github.com/${/\[bot\]$/.test(actor) ? 'actions' : actor }.png`">
<a :href="`https://github.com/${actor}`">{{ actor }}</a> <a :href="`https://github.com/${actor}`">{{ actor }}</a>

View File

@@ -163,7 +163,7 @@
<% } %> <% } %>
<% if (plugins.activity.timestamps) { %> <% if (plugins.activity.timestamps) { %>
<div class="timestamp"> <div class="timestamp">
<%= f.date(timestamp, {timeStyle:"short", dateStyle:"short"}) %> <%= f.date(timestamp, {timeStyle:"short", dateStyle:"short", timeZone:config.timezone?.name}) %>
</div> </div>
<% } %> <% } %>
</section> </section>

View File

@@ -23,7 +23,7 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M4.75 0a.75.75 0 01.75.75V2h5V.75a.75.75 0 011.5 0V2h1.25c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0113.25 16H2.75A1.75 1.75 0 011 14.25V3.75C1 2.784 1.784 2 2.75 2H4V.75A.75.75 0 014.75 0zm0 3.5h8.5a.25.25 0 01.25.25V6h-11V3.75a.25.25 0 01.25-.25h2zm-2.25 4v6.75c0 .138.112.25.25.25h10.5a.25.25 0 00.25-.25V7.5h-11z"></path></svg> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M4.75 0a.75.75 0 01.75.75V2h5V.75a.75.75 0 011.5 0V2h1.25c.966 0 1.75.784 1.75 1.75v10.5A1.75 1.75 0 0113.25 16H2.75A1.75 1.75 0 011 14.25V3.75C1 2.784 1.784 2 2.75 2H4V.75A.75.75 0 014.75 0zm0 3.5h8.5a.25.25 0 01.25.25V6h-11V3.75a.25.25 0 01.25-.25h2zm-2.25 4v6.75c0 .138.112.25.25.25h10.5a.25.25 0 00.25-.25V7.5h-11z"></path></svg>
<div class="infos"> <div class="infos">
<div class="left"> <div class="left">
<div class="date"><%= f.date(new Date(date), {dateStyle:"short"}) %></div> <div class="date"><%= f.date(new Date(date), {dateStyle:"short", timeZone:config.timezone?.name}) %></div>
<% if (plugins.posts.covers) { %> <% if (plugins.posts.covers) { %>
<div class="cover" style="background-image: url(<%= image %>);"></div> <div class="cover" style="background-image: url(<%= image %>);"></div>
<% } %> <% } %>

View File

@@ -18,7 +18,7 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M8 5.5a2.5 2.5 0 100 5 2.5 2.5 0 000-5zM4 8a4 4 0 118 0 4 4 0 01-8 0z"></path></svg> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M8 5.5a2.5 2.5 0 100 5 2.5 2.5 0 000-5zM4 8a4 4 0 118 0 4 4 0 01-8 0z"></path></svg>
<div class="infos"> <div class="infos">
<div class="title"><%= title %></div> <div class="title"><%= title %></div>
<div class="date"><%= f.date(new Date(date), {dateStyle:"short"}) %></div> <div class="date"><%= f.date(new Date(date), {dateStyle:"short", timeZone:config.timezone?.name}) %></div>
</div> </div>
</div> </div>
<% } %> <% } %>

View File

@@ -39,7 +39,7 @@
* 🚮 Deleted <%= event.ref.type %> `<%= event.ref.name %>` from [<%= repo %>](https://github.com/<%= repo %>) * 🚮 Deleted <%= event.ref.type %> `<%= event.ref.name %>` from [<%= repo %>](https://github.com/<%= repo %>)
<%_ } _%> <%_ } _%>
<%_ if (plugins.activity.timestamps) { _%> <%_ if (plugins.activity.timestamps) { _%>
* *On <%= f.date(timestamp, {timeStyle:"short", dateStyle:"short"}) %>* * *On <%= f.date(timestamp, {timeStyle:"short", dateStyle:"short", timeZone:config.timezone?.name}) %>*
<%_ } _%> <%_ } _%>
<%_ } _%> <%_ } _%>
<%_ } else { _%> <%_ } else { _%>

View File

@@ -19,7 +19,7 @@
<td> <td>
<%= description %> <%= description %>
<br> <br>
<i>Published on <%= f.date(new Date(date), {dateStyle:"short"}) %></i> <i>Published on <%= f.date(new Date(date), {dateStyle:"short", timeZone:config.timezone?.name}) %></i>
</td> </td>
</tr> </tr>
</table> </table>
@@ -27,7 +27,7 @@
<%_ } else if (plugins.posts.list.length) { _%> <%_ } else if (plugins.posts.list.length) { _%>
<%_ for (const {title, date, link} of plugins.posts.list) { _%> <%_ for (const {title, date, link} of plugins.posts.list) { _%>
* [<%= title.trim() %>](<%= link %>) * [<%= title.trim() %>](<%= link %>)
* *Published on <%= f.date(new Date(date), {dateStyle:"short"}) %>* * *Published on <%= f.date(new Date(date), {dateStyle:"short", timeZone:config.timezone?.name}) %>*
<%_ } _%> <%_ } _%>
<%_ } else { _%> <%_ } else { _%>
No recent posts No recent posts

View File

@@ -163,7 +163,7 @@
<% } %> <% } %>
<% if (plugins.activity.timestamps) { %> <% if (plugins.activity.timestamps) { %>
<div class="timestamp"> <div class="timestamp">
<%= f.date(timestamp, {timeStyle:"short", dateStyle:"short"}) %> <%= f.date(timestamp, {timeStyle:"short", dateStyle:"short", timeZone:config.timezone?.name}) %>
</div> </div>
<% } %> <% } %>
</section> </section>

View File

@@ -18,7 +18,7 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M8 5.5a2.5 2.5 0 100 5 2.5 2.5 0 000-5zM4 8a4 4 0 118 0 4 4 0 01-8 0z"></path></svg> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M8 5.5a2.5 2.5 0 100 5 2.5 2.5 0 000-5zM4 8a4 4 0 118 0 4 4 0 01-8 0z"></path></svg>
<div class="infos"> <div class="infos">
<div class="title"><%= title %></div> <div class="title"><%= title %></div>
<div class="date"><%= f.date(new Date(date), {dateStyle:"short"}) %></div> <div class="date"><%= f.date(new Date(date), {dateStyle:"short", timeZone:config.timezone?.name}) %></div>
</div> </div>
</div> </div>
<% } %> <% } %>