Skip to content

Commit

Permalink
clarity updates
Browse files Browse the repository at this point in the history
  • Loading branch information
pablodanswer committed Nov 6, 2024
1 parent f450a61 commit 1304514
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions web/src/components/search/filtering/Filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export function SourceSelector({
<div className="cursor-pointer">
<SectionTitle>Time Range</SectionTitle>
<p className="text-sm text-default mt-2">
{getTimeAgoString(timeRange?.from!)}
{getTimeAgoString(timeRange?.from!) || "Select a time range"}
</p>
</div>
</PopoverTrigger>
Expand Down Expand Up @@ -463,7 +463,6 @@ export function HorizontalSourceSelector({
border-border
rounded-lg
bg-background
flex
max-h-96
overflow-y-scroll
overscroll-contain
Expand Down
2 changes: 1 addition & 1 deletion web/src/lib/dateUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export const buildDateString = (date: Date | null) => {
: "Select a time range";
};
export const getTimeAgoString = (date: Date | null) => {
if (!date) return "Since";
if (!date) return null;

const diffMs = new Date().getTime() - date.getTime();
const diffDays = Math.floor(diffMs / (1000 * 60 * 60 * 24));
Expand Down

0 comments on commit 1304514

Please sign in to comment.