Time in a more human readable format
This commit is contained in:
parent
1e04628fdf
commit
5da1494081
3 changed files with 12 additions and 2 deletions
5
deno.lock
generated
5
deno.lock
generated
|
@ -6,6 +6,7 @@
|
|||
"npm:@atcute/identity-resolver@~0.1.2": "0.1.2_@atcute+identity@0.1.3",
|
||||
"npm:@sveltejs/vite-plugin-svelte@^5.0.3": "5.0.3_svelte@5.28.1__acorn@8.14.1_vite@6.3.2__picomatch@4.0.2",
|
||||
"npm:@tsconfig/svelte@^5.0.4": "5.0.4",
|
||||
"npm:moment@^2.30.1": "2.30.1",
|
||||
"npm:svelte-check@^4.1.5": "4.1.6_svelte@5.28.1__acorn@8.14.1_typescript@5.7.3",
|
||||
"npm:svelte@^5.23.1": "5.28.1_acorn@8.14.1",
|
||||
"npm:typescript@~5.7.2": "5.7.3",
|
||||
|
@ -337,6 +338,9 @@
|
|||
"@jridgewell/sourcemap-codec"
|
||||
]
|
||||
},
|
||||
"moment@2.30.1": {
|
||||
"integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how=="
|
||||
},
|
||||
"mri@1.2.0": {
|
||||
"integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA=="
|
||||
},
|
||||
|
@ -470,6 +474,7 @@
|
|||
"npm:@atcute/identity-resolver@~0.1.2",
|
||||
"npm:@sveltejs/vite-plugin-svelte@^5.0.3",
|
||||
"npm:@tsconfig/svelte@^5.0.4",
|
||||
"npm:moment@^2.30.1",
|
||||
"npm:svelte-check@^4.1.5",
|
||||
"npm:svelte@^5.23.1",
|
||||
"npm:typescript@~5.7.2",
|
||||
|
|
|
@ -12,7 +12,8 @@
|
|||
"dependencies": {
|
||||
"@atcute/bluesky": "^2.0.2",
|
||||
"@atcute/client": "^3.0.1",
|
||||
"@atcute/identity-resolver": "^0.1.2"
|
||||
"@atcute/identity-resolver": "^0.1.2",
|
||||
"moment": "^2.30.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sveltejs/vite-plugin-svelte": "^5.0.3",
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
import { Post } from "./pdsfetch";
|
||||
import { Config } from "../../config";
|
||||
import { onMount } from "svelte";
|
||||
import moment from "moment";
|
||||
|
||||
let { post }: { post: Post } = $props();
|
||||
|
||||
|
@ -76,7 +77,9 @@
|
|||
<a
|
||||
id="postLink"
|
||||
href="{Config.FRONTEND_URL}/profile/{post.authorDid}/post/{post.recordName}"
|
||||
>{post.timenotstamp}</a
|
||||
>{moment(post.timenotstamp).isBefore(moment().subtract(1, 'month'))
|
||||
? moment(post.timenotstamp).format('MMM D, YYYY')
|
||||
: moment(post.timenotstamp).fromNow()}</a
|
||||
>
|
||||
</p>
|
||||
</div>
|
||||
|
@ -131,6 +134,7 @@
|
|||
</div>
|
||||
{/if}
|
||||
{#if post.videosLinkCid}
|
||||
<!-- svelte-ignore a11y_media_has_caption -->
|
||||
<video
|
||||
id="embedVideo"
|
||||
src="{Config.PDS_URL}/xrpc/com.atproto.sync.getBlob?did={post.authorDid}&cid={post.videosLinkCid}"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue