Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.
Go dockerfossgomarkdownmemomicroblognote-takingnotesopen-sourceown-your-datareactself-hostedsqlitetimeline
chore: update related time format (#1621)
boojack8911ea1619e6
diff --git a/web/src/components/UsageHeatMap.tsx b/web/src/components/UsageHeatMap.tsxindex dad9a078b..947065e8c 100644--- a/web/src/components/UsageHeatMap.tsx+++ b/web/src/components/UsageHeatMap.tsx@@ -110,7 +110,7 @@ const UsageHeatMap = () => {// This interpolation is not being used because of the current styling,// but it can improve translation quality by giving it a more meaningful context- const tMemoInOpts = { amount: "", period: "", date: "" };+ const tMemoInOpts = { amount: memoAmount, period: "", date: "" };return (<>diff --git a/web/src/helpers/datetime.ts b/web/src/helpers/datetime.tsindex 74f775b06..53f388a0f 100644--- a/web/src/helpers/datetime.ts+++ b/web/src/helpers/datetime.ts@@ -121,6 +121,17 @@ export const getRelativeTimeString = (time: number, locale = i18n.language, formconst minMillis = secMillis * 60;const hourMillis = minMillis * 60;const dayMillis = hourMillis * 24;+ // Show full date if more than 1 day ago.+ if (pastTimeMillis >= dayMillis) {+ return new Date(time).toLocaleDateString(locale, {+ year: "numeric",+ month: "numeric",+ day: "numeric",+ hour: "numeric",+ minute: "numeric",+ second: "numeric",+ });+ }// numeric: "auto" provides "yesterday" for 1 day ago, "always" provides "1 day ago"const formatOpts = { style: formatStyle, numeric: "auto" } as Intl.RelativeTimeFormatOptions;diff --git a/web/src/locales/en.json b/web/src/locales/en.jsonindex 025f87348..8e1088807 100644--- a/web/src/locales/en.json+++ b/web/src/locales/en.json@@ -110,7 +110,7 @@"reset-link-prompt": "Are you sure to reset the link?\nThis will break all current link usages.\n\nTHIS ACTION IS IRREVERSIBLE❗","delete-resource": "Delete Resource","linked-amount": "Linked amount",- "warning-text": "Are you sure to delete this resource?\n\nTHIS ACTION IS IRREVERSIBLE❗",+ "warning-text": "Are you sure to delete this resource?\n\nTHIS ACTION IS IRREVERSIBLE❗","warning-text-unused": "Are you sure to delete these unused resources?\n\nTHIS ACTION IS IRREVERSIBLE❗","no-unused-resources": "No unused resources","delete-selected-resources": "Delete Selected Resources",@@ -373,8 +373,8 @@"copy": "Copy"},"heatmap": {- "memo-in": "{{amount}} memo in {{period}}",- "memos-in": "{{amount}} memos in {{period}}",+ "memo-in": "memo in {{period}}",+ "memos-in": "memos in {{period}}","memo-on": "{{amount}} memo on {{date}}","memos-on": "{{amount}} memos on {{date}}","day": "day",@@ -387,4 +387,4 @@"powered-by": "Powered by","other-projects": "Other Projects"}-}\ No newline at end of file+}diff --git a/web/src/locales/ko.json b/web/src/locales/ko.jsonindex 1c180dbbb..ebcfcec46 100644--- a/web/src/locales/ko.json+++ b/web/src/locales/ko.json@@ -373,8 +373,8 @@"copy": "복사"},"heatmap": {- "memo-in": "{{period}}동안 메모 {{amount}}개 작성",- "memos-in": "{{period}}동안 메모 {{amount}}개 작성",+ "memo-in": "동안 메모 {{amount}}개 작성",+ "memos-in": "동안 메모 {{amount}}개 작성","memo-on": "{{date}}에 메모 {{amount}}개 작성","memos-on": "{{date}}에 메모 {{amount}}개 작성","day": "일",diff --git a/web/src/locales/pt-BR.json b/web/src/locales/pt-BR.jsonindex 9e53ca3c4..e4971c21f 100644--- a/web/src/locales/pt-BR.json+++ b/web/src/locales/pt-BR.json@@ -110,7 +110,7 @@"reset-link-prompt": "Tem certeza de que deseja redefinir o link?\nIsso quebrará todos os vínculos atuais.\n\nESTA AÇÃO É IRREVERSÍVEL❗","delete-resource": "Deletar recurso","linked-amount": "Quantidade de vínculos",- "warning-text": "Tem certeza de que deseja deletar este recurso?\n\nESTA AÇÃO É IRREVERSÍVEL❗",+ "warning-text": "Tem certeza de que deseja deletar este recurso?\n\nESTA AÇÃO É IRREVERSÍVEL❗","warning-text-unused": "Tem certeza de que deseja deletar este recurso não utilizado?\n\nESTA AÇÃO É IRREVERSÍVEL❗","no-unused-resources": "Nenhum recurso não utilizado","delete-selected-resources": "Deletar recursos selecionados",@@ -373,8 +373,8 @@"copy": "Copiar"},"heatmap": {- "memo-in": "{{amount}} memo em {{period}}",- "memos-in": "{{amount}} memos em {{period}}",+ "memo-in": "memo em {{period}}",+ "memos-in": "memos em {{period}}","memo-on": "{{amount}} memo em {{date}}","memos-on": "{{amount}} memos em {{date}}","day": "dia",diff --git a/web/src/locales/zh-Hans.json b/web/src/locales/zh-Hans.jsonindex effdabeb2..20e7dac7d 100644--- a/web/src/locales/zh-Hans.json+++ b/web/src/locales/zh-Hans.json@@ -98,7 +98,7 @@"username": "用户名","vacuum": "清理未使用资源","version": "版本",- "visibility": "可见度",+ "visibility": "可见性","yourself": "你自己"},"daily-review": {@@ -155,7 +155,7 @@"tag": "标签","text": "文本","type": "类型",- "visibility": "可见度"+ "visibility": "可见性"},"value": {"has-attachment": "包含附件",@@ -166,9 +166,9 @@"heatmap": {"day": "天","days": "天",- "memo-in": "{{period}} 记了 {{amount}} 条备忘录",+ "memo-in": " 条 memos",+ "memos-in": " 条 memos","memo-on": "{{date}} 记了 {{amount}} 条备忘录",- "memos-in": "{{period}} 记了 {{amount}} 条备忘录","memos-on": "{{date}} 记了 {{amount}} 条备忘录"},"memo": {@@ -324,7 +324,6 @@"daily-review-time-offset": "每日回顾时间偏移","default-memo-sort-option": "备忘录显示时间","default-memo-visibility": "默认备忘录可见性",- "default-resource-visibility": "默认资源可见度","editor-font-style": "编辑器字体样式","enable-double-click": "开启双击编辑","enable-folding-memo": "开启折叠备忘录",@@ -428,4 +427,4 @@"tag-name": "标签名称","tip-text": "输入`#tag`来创建标签"}-}\ No newline at end of file+}diff --git a/web/src/locales/zh-Hant.json b/web/src/locales/zh-Hant.jsonindex a24bf62f6..bb78c5730 100644--- a/web/src/locales/zh-Hant.json+++ b/web/src/locales/zh-Hant.json@@ -110,7 +110,7 @@"reset-link-prompt": "您確定要重設連結?\n這將會破壞所有目前的使用中的連結。\n\n此動作為不可逆❗","delete-resource": "刪除資源","linked-amount": "連結的 Memo 數量",- "warning-text": "您確定要刪除此資源?\n\n此動作為不可逆❗",+ "warning-text": "您確定要刪除此資源?\n\n此動作為不可逆❗","warning-text-unused": "您確定要刪除這些未使用的資源?\n\n此動作為不可逆❗","no-unused-resources": "無未使用的資源","delete-selected-resources": "刪除所選的資源",@@ -373,8 +373,8 @@"copy": "複製"},"heatmap": {- "memo-in": "{{amount}} memo in {{period}}",- "memos-in": "{{amount}} memos in {{period}}",+ "memo-in": "memo in {{period}}",+ "memos-in": "memos in {{period}}","memo-on": "{{amount}} memo on {{date}}","memos-on": "{{amount}} memos on {{date}}","day": "天",