this repo has no description

Time in a more human readable format

ari.express e1665b6c 9fe004f4

verified
Changed files
+12 -2
src
+5
deno.lock
··· 6 6 "npm:@atcute/identity-resolver@~0.1.2": "0.1.2_@atcute+identity@0.1.3", 7 7 "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", 8 8 "npm:@tsconfig/svelte@^5.0.4": "5.0.4", 9 + "npm:moment@^2.30.1": "2.30.1", 9 10 "npm:svelte-check@^4.1.5": "4.1.6_svelte@5.28.1__acorn@8.14.1_typescript@5.7.3", 10 11 "npm:svelte@^5.23.1": "5.28.1_acorn@8.14.1", 11 12 "npm:typescript@~5.7.2": "5.7.3", ··· 337 338 "@jridgewell/sourcemap-codec" 338 339 ] 339 340 }, 341 + "moment@2.30.1": { 342 + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==" 343 + }, 340 344 "mri@1.2.0": { 341 345 "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==" 342 346 }, ··· 470 474 "npm:@atcute/identity-resolver@~0.1.2", 471 475 "npm:@sveltejs/vite-plugin-svelte@^5.0.3", 472 476 "npm:@tsconfig/svelte@^5.0.4", 477 + "npm:moment@^2.30.1", 473 478 "npm:svelte-check@^4.1.5", 474 479 "npm:svelte@^5.23.1", 475 480 "npm:typescript@~5.7.2",
+2 -1
package.json
··· 12 12 "dependencies": { 13 13 "@atcute/bluesky": "^2.0.2", 14 14 "@atcute/client": "^3.0.1", 15 - "@atcute/identity-resolver": "^0.1.2" 15 + "@atcute/identity-resolver": "^0.1.2", 16 + "moment": "^2.30.1" 16 17 }, 17 18 "devDependencies": { 18 19 "@sveltejs/vite-plugin-svelte": "^5.0.3",
+5 -1
src/lib/PostComponent.svelte
··· 2 2 import { Post } from "./pdsfetch"; 3 3 import { Config } from "../../config"; 4 4 import { onMount } from "svelte"; 5 + import moment from "moment"; 5 6 6 7 let { post }: { post: Post } = $props(); 7 8 ··· 76 77 <a 77 78 id="postLink" 78 79 href="{Config.FRONTEND_URL}/profile/{post.authorDid}/post/{post.recordName}" 79 - >{post.timenotstamp}</a 80 + >{moment(post.timenotstamp).isBefore(moment().subtract(1, 'month')) 81 + ? moment(post.timenotstamp).format('MMM D, YYYY') 82 + : moment(post.timenotstamp).fromNow()}</a 80 83 > 81 84 </p> 82 85 </div> ··· 131 134 </div> 132 135 {/if} 133 136 {#if post.videosLinkCid} 137 + <!-- svelte-ignore a11y_media_has_caption --> 134 138 <video 135 139 id="embedVideo" 136 140 src="{Config.PDS_URL}/xrpc/com.atproto.sync.getBlob?did={post.authorDid}&cid={post.videosLinkCid}"