diff options
| author | Brandon Wong <29965003+brandonw3612@users.noreply.github.com> | 2025-04-13 22:50:45 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-13 21:50:45 +0100 |
| commit | 95f504c0bc0b9ec0930b6c6facefc1a8ea093192 (patch) | |
| tree | 967221d7f4f5b716cc8fd3d92b5869bacf1d6089 /apps | |
| parent | 5bdb2d944a08f63772497e203f47533ffb640d82 (diff) | |
| download | karakeep-95f504c0bc0b9ec0930b6c6facefc1a8ea093192.tar.zst | |
feat: add support for filtering by bookmark age (#1228)
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/web/components/dashboard/search/QueryExplainerTooltip.tsx | 26 | ||||
| -rw-r--r-- | apps/web/lib/i18n/locales/en/translation.json | 10 |
2 files changed, 36 insertions, 0 deletions
diff --git a/apps/web/components/dashboard/search/QueryExplainerTooltip.tsx b/apps/web/components/dashboard/search/QueryExplainerTooltip.tsx index 89c15ad5..e6abb9c9 100644 --- a/apps/web/components/dashboard/search/QueryExplainerTooltip.tsx +++ b/apps/web/components/dashboard/search/QueryExplainerTooltip.tsx @@ -66,6 +66,32 @@ export default function QueryExplainerTooltip({ <TableCell>{matcher.dateBefore.toDateString()}</TableCell> </TableRow> ); + case "age": + return ( + <TableRow> + <TableCell> + {matcher.relativeDate.direction === "newer" + ? t("search.created_within") + : t("search.created_earlier_than")} + </TableCell> + <TableCell> + {matcher.relativeDate.amount.toString() + + (matcher.relativeDate.direction === "newer" + ? { + day: t("search.day_s"), + week: t("search.week_s"), + month: t("search.month_s"), + year: t("search.year_s"), + }[matcher.relativeDate.unit] + : { + day: t("search.day_s_ago"), + week: t("search.week_s_ago"), + month: t("search.month_s_ago"), + year: t("search.year_s_ago"), + }[matcher.relativeDate.unit])} + </TableCell> + </TableRow> + ); case "favourited": return ( <TableRow> diff --git a/apps/web/lib/i18n/locales/en/translation.json b/apps/web/lib/i18n/locales/en/translation.json index f76d0f33..4cce6295 100644 --- a/apps/web/lib/i18n/locales/en/translation.json +++ b/apps/web/lib/i18n/locales/en/translation.json @@ -258,6 +258,16 @@ "not_created_on_or_after": "Not Created on or After", "created_on_or_before": "Created on or Before", "not_created_on_or_before": "Not Created on or Before", + "created_within": "Created Within", + "created_earlier_than": "Created Earlier Than", + "day_s": " Day(s)", + "week_s": " Week(s)", + "month_s": " Month(s)", + "year_s": " Year(s)", + "day_s_ago": " Day(s) Ago", + "week_s_ago": " Week(s) Ago", + "month_s_ago": " Month(s) Ago", + "year_s_ago": " Year(s) Ago", "url_contains": "URL Contains", "url_does_not_contain": "URL Does Not Contain", "is_in_list": "Is In List", |
