Show full date and time in post timestamp tooltip

This commit is contained in:
silverpill 2023-01-20 19:10:39 +00:00
parent f9b17605aa
commit d6efbd467f
3 changed files with 12 additions and 3 deletions

View file

@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [Unreleased]
### Fixed
- Show full date and time in post timestamp tooltip.
## [1.10.0] - 2023-01-18
### Added

View file

@ -1,5 +1,5 @@
<template>
<div class="post" :class="{ 'highlighted': highlighted }" :data-post-id="post.id" :id="post.id">
<div class="post" :class="{ highlighted: highlighted }" :data-post-id="post.id" :id="post.id">
<div class="post-header">
<a
class="floating-avatar"
@ -40,7 +40,7 @@
<a
class="timestamp"
:href="post.uri"
:title="formatDate(post.created_at)"
:title="formatDateTime(post.created_at)"
@click="openPost($event, post.id)"
>
{{ humanizeDate(post.created_at) }}
@ -266,7 +266,7 @@ import { useInstanceInfo } from "@/store/instance"
import { useCurrentUser } from "@/store/user"
import { CRYPTOCURRENCIES } from "@/utils/cryptocurrencies"
import { getWallet } from "@/utils/ethereum"
import { formatDate, humanizeDate } from "@/utils/dates"
import { formatDateTime, humanizeDate } from "@/utils/dates"
interface PaymentOption {
code: string;

View file

@ -24,3 +24,8 @@ export function formatDate(isoDate: string): string {
const date = DateTime.fromISO(isoDate)
return date.toLocaleString()
}
export function formatDateTime(isoDate: string): string {
const date = DateTime.fromISO(isoDate)
return date.toLocaleString(DateTime.DATETIME_FULL)
}