From ffc48297b21cf2a2e577b115f9c18d4416d1be9e Mon Sep 17 00:00:00 2001 From: nieve Date: Fri, 16 May 2025 16:43:50 -0400 Subject: [PATCH 1/2] timestamps hover --- Grayjay.Desktop.Web/src/components/CommentView/index.tsx | 2 +- .../src/components/PlaylistItemView/index.tsx | 2 +- Grayjay.Desktop.Web/src/components/RepliesOverlay/index.tsx | 2 +- .../components/content/LockedContentThumbnailView/index.tsx | 2 +- .../components/content/NestedMediaThumbnailView/index.tsx | 2 +- .../src/components/content/PostThumbnailView/index.tsx | 2 +- .../src/components/content/VideoThumbnailView/index.tsx | 5 ++++- .../src/components/contentDetails/PostDetailsView/index.tsx | 2 +- .../src/components/contentDetails/VideoDetailView/index.tsx | 6 +++--- 9 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Grayjay.Desktop.Web/src/components/CommentView/index.tsx b/Grayjay.Desktop.Web/src/components/CommentView/index.tsx index 846e8db8..e09a65b3 100644 --- a/Grayjay.Desktop.Web/src/components/CommentView/index.tsx +++ b/Grayjay.Desktop.Web/src/components/CommentView/index.tsx @@ -61,7 +61,7 @@ const CommentView: Component = (props) => {
{props.comment?.author.name}
-
{toHumanNowDiffString(props.comment?.date)}
+
{toHumanNowDiffString(props.comment?.date)}
preventDragDrop(ev)} />
diff --git a/Grayjay.Desktop.Web/src/components/PlaylistItemView/index.tsx b/Grayjay.Desktop.Web/src/components/PlaylistItemView/index.tsx
index b4fffecd..b1f1383a 100644
--- a/Grayjay.Desktop.Web/src/components/PlaylistItemView/index.tsx
+++ b/Grayjay.Desktop.Web/src/components/PlaylistItemView/index.tsx
@@ -54,7 +54,7 @@ const PlaylistItemView: Component = (props) => {
               e.stopPropagation();
             }}>{props.item?.author.name}
             
-              
0}>{toHumanNumber(props.item?.viewCount)} • {toHumanNowDiffString(props.item?.dateTime)}
+
0}>{toHumanNumber(props.item?.viewCount)} • {toHumanNowDiffString(props.item?.dateTime)}
diff --git a/Grayjay.Desktop.Web/src/components/RepliesOverlay/index.tsx b/Grayjay.Desktop.Web/src/components/RepliesOverlay/index.tsx index 79b3a8d1..725a248c 100644 --- a/Grayjay.Desktop.Web/src/components/RepliesOverlay/index.tsx +++ b/Grayjay.Desktop.Web/src/components/RepliesOverlay/index.tsx @@ -34,7 +34,7 @@ const RepliesOverlay: Component = (props) => {
{props.comment?.author.name}
-
{toHumanNowDiffString(props.comment?.date)}
+
{toHumanNowDiffString(props.comment?.date)}
diff --git a/Grayjay.Desktop.Web/src/components/content/LockedContentThumbnailView/index.tsx b/Grayjay.Desktop.Web/src/components/content/LockedContentThumbnailView/index.tsx
index 5ba917a4..6c2fd5d6 100644
--- a/Grayjay.Desktop.Web/src/components/content/LockedContentThumbnailView/index.tsx
+++ b/Grayjay.Desktop.Web/src/components/content/LockedContentThumbnailView/index.tsx
@@ -83,7 +83,7 @@ const LockedContentThumbnailView: Component = (props) => {
             }}>
                 
{props.content?.author.name}
-
{toHumanNowDiffString(props.content?.dateTime)}
+
{toHumanNowDiffString(props.content?.dateTime)}
diff --git a/Grayjay.Desktop.Web/src/components/content/NestedMediaThumbnailView/index.tsx b/Grayjay.Desktop.Web/src/components/content/NestedMediaThumbnailView/index.tsx index 0d15b826..f02da1b0 100644 --- a/Grayjay.Desktop.Web/src/components/content/NestedMediaThumbnailView/index.tsx +++ b/Grayjay.Desktop.Web/src/components/content/NestedMediaThumbnailView/index.tsx @@ -72,7 +72,7 @@ const NestedMediaThumbnailView: Component = (props) => { }}>
{props.video?.author.name}
-
{toHumanNowDiffString(props.video?.dateTime)}
+
{toHumanNowDiffString(props.video?.dateTime)}
diff --git a/Grayjay.Desktop.Web/src/components/content/PostThumbnailView/index.tsx b/Grayjay.Desktop.Web/src/components/content/PostThumbnailView/index.tsx index f767af5c..79e4ff79 100644 --- a/Grayjay.Desktop.Web/src/components/content/PostThumbnailView/index.tsx +++ b/Grayjay.Desktop.Web/src/components/content/PostThumbnailView/index.tsx @@ -74,7 +74,7 @@ const PostThumbnailView: Component = (props) => { }}>
{props.post?.author.name}
-
{toHumanNowDiffString(props.post?.dateTime)}
+
{toHumanNowDiffString(props.post?.dateTime)}
diff --git a/Grayjay.Desktop.Web/src/components/content/VideoThumbnailView/index.tsx b/Grayjay.Desktop.Web/src/components/content/VideoThumbnailView/index.tsx index 89e0ff08..ed84cfaa 100644 --- a/Grayjay.Desktop.Web/src/components/content/VideoThumbnailView/index.tsx +++ b/Grayjay.Desktop.Web/src/components/content/VideoThumbnailView/index.tsx @@ -94,7 +94,10 @@ const VideoThumbnailView: Component = (props) => { }}>
{props.video?.author?.name ?? "Unknown"}
-
0}>{toHumanNumber(props.video?.viewCount)} views • {toHumanNowDiffString(props.video?.dateTime)}
+
+ 0}>{toHumanNumber(props.video?.viewCount)} views • + {toHumanNowDiffString(props.video?.dateTime)} +
diff --git a/Grayjay.Desktop.Web/src/components/contentDetails/PostDetailsView/index.tsx b/Grayjay.Desktop.Web/src/components/contentDetails/PostDetailsView/index.tsx index 2c841c88..8038f1f2 100644 --- a/Grayjay.Desktop.Web/src/components/contentDetails/PostDetailsView/index.tsx +++ b/Grayjay.Desktop.Web/src/components/contentDetails/PostDetailsView/index.tsx @@ -79,7 +79,7 @@ const PostDetailView: Component = () => { {details$()?.post?.name}
-
+
{toHumanNowDiffString(details$()?.post?.dateTime)}
diff --git a/Grayjay.Desktop.Web/src/components/contentDetails/VideoDetailView/index.tsx b/Grayjay.Desktop.Web/src/components/contentDetails/VideoDetailView/index.tsx index 041f9c02..9858f31f 100644 --- a/Grayjay.Desktop.Web/src/components/contentDetails/VideoDetailView/index.tsx +++ b/Grayjay.Desktop.Web/src/components/contentDetails/VideoDetailView/index.tsx @@ -1211,8 +1211,8 @@ const VideoDetailView: Component = (props) => {
{item()?.name}
-
{item()?.author?.name}
-
0}>{toHumanNumber(item()?.viewCount)} views • {toHumanNowDiffString(item()?.dateTime)}
+
{item()?.author?.name}
+
0}>{toHumanNumber(item()?.viewCount)} views • {toHumanNowDiffString(item()?.dateTime)}
); @@ -1364,7 +1364,7 @@ const VideoDetailView: Component = (props) => {
preventDragDrop(ev)}>{name$()}
-
{metadata$()}
+
{metadata$()}
From 2e87f6fe89497199ee45d517b0bea83f6d6a5e94 Mon Sep 17 00:00:00 2001 From: nieve Date: Fri, 16 May 2025 16:43:53 -0400 Subject: [PATCH 2/2] Update utility.ts --- Grayjay.Desktop.Web/src/utility.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Grayjay.Desktop.Web/src/utility.ts b/Grayjay.Desktop.Web/src/utility.ts index 20344e84..0939664b 100644 --- a/Grayjay.Desktop.Web/src/utility.ts +++ b/Grayjay.Desktop.Web/src/utility.ts @@ -213,8 +213,7 @@ export function dateFromAny(value?: any, def?: DateTime): DateTime | undefined { if(!isNaN(value)) { //TODO: Alt solution - const wrongOffset = ((new Date()).getTimezoneOffset()/60); - return DateTime.fromSeconds(value).plus({hours: wrongOffset}); + return DateTime.fromSeconds(value); } if(typeof value == "string") return DateTime.fromISO(value);