atproto explorer
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

only show correct timestamp

+5 -7
+5 -7
src/views/collection.tsx
··· 54 54 "listRecords", 55 55 ); 56 56 57 - const getDateFromTID = (rkey: string) => 58 - new Date( 59 - TID.parse(rkey).timestamp / 1000 - 60 - new Date().getTimezoneOffset() * 60 * 1000, 61 - ) 57 + const getDateFromTimestamp = (timestamp: number) => 58 + new Date(timestamp - new Date().getTimezoneOffset() * 60 * 1000) 62 59 .toISOString() 63 60 .split(".")[0] 64 61 .replace("T", " "); ··· 82 79 ) 83 80 .map((record) => { 84 81 const rkey = record.uri.split("/").pop()!; 82 + const timestamp = TID.parse(rkey).timestamp / 1000; 85 83 return ( 86 84 <A 87 85 href={`${rkey}`} 88 86 class="hover:bg-neutral-300 dark:hover:bg-neutral-700" 89 87 > 90 88 <span class="text-lightblue-500">{rkey}</span> 91 - <Show when={TID.validate(rkey)}> 89 + <Show when={TID.validate(rkey) && timestamp <= Date.now()}> 92 90 <span class="ml-2 text-xs text-neutral-500 dark:text-neutral-400"> 93 - {getDateFromTID(rkey)} 91 + {getDateFromTimestamp(timestamp)} 94 92 </span> 95 93 </Show> 96 94 </A>