Skip to content

Commit

Permalink
show full date and time for gated messages instead of relative time ago
Browse files Browse the repository at this point in the history
  • Loading branch information
liamcottle authored and KomelT committed Dec 13, 2024
1 parent 14e38c1 commit 68a31d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/public/text-messages-embed.html
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<div class="border border-gray-300 rounded-xl shadow overflow-hidden bg-[#efefef] divide-y">
<div class="w-full space-y-0.5 px-2.5 py-1" v-html="escapeMessageText(message.text)" style="white-space:pre-wrap;word-break:break-word;"></div>
<div v-if="message.is_details_expanded" class="text-xs text-gray-500 px-2 py-1">
<span :title="message.created_at">{{ moment(new Date(message.created_at)).fromNow() }}</span>
<span :title="message.created_at">{{ formatMessageTimestamp(message.created_at) }}</span>
<span> • Gated by <a target="_blank" :href="`/?node_id=${message.gateway_id}`" class="hover:text-blue-500">{{ getNodeName(message.gateway_id) }}</a></span>
</div>
</div>
Expand Down Expand Up @@ -351,6 +351,9 @@
.replaceAll('>', '&gt;')
.replaceAll('\n', '<br/>');
},
formatMessageTimestamp(createdAt) {
return moment(new Date(createdAt)).local().format("DD/MMM/YYYY hh:mm:A");
},
},
computed: {
reversedMessages() {
Expand Down

0 comments on commit 68a31d2

Please sign in to comment.